-
-
Save ElectricMaxxx/5442006 to your computer and use it in GitHub Desktop.
problem with this.$el in backbone.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #in the container | |
| layout = Backbone.View.extend({ | |
| el:"body" | |
| initialize: -> | |
| this.template = template.layout | |
| this.navigation = new navigation() | |
| this.render() | |
| render:-> | |
| opt= | |
| container: config.option.container | |
| res = Mustache.compile this.template | |
| this.$el.empty() | |
| this.$el.append res opt | |
| this.navigation.render() | |
| this | |
| }); | |
| #in the navigation: | |
| navigation = Backbone.View.extend({ | |
| el:"#navigation" | |
| initialize:-> | |
| this.template = template.navigation | |
| render:-> | |
| ### | |
| opt= | |
| option: config.option | |
| content: | |
| label: | |
| menue: interpreter.get "menue" | |
| views: interpreter.get "views" | |
| uploadFiles: interpreter.get "uploadFiles" | |
| preview: interpreter.get "preview" | |
| details: interpreter.get "details" | |
| dirView: interpreter.get "dirView" | |
| process: interpreter.get "process" | |
| res = Mustache.compile this.template | |
| ### | |
| this.$el.empty() | |
| this.$el.append "<h1>Testing<h1>" | |
| #$("#navigation").append "<h1>Testing<h1>" | |
| this | |
| }) | |
| #the template: | |
| <div id="{{container}}" class="wrapper"> | |
| <div id="navigation"></div> | |
| <div id="browser"></div> | |
| <div id="filter"></div> | |
| </div> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
its solved, i can`t instantiate the views of the inner parts before the outer ones are rendered