Created
April 26, 2012 16:59
-
-
Save jshirley/2500965 to your computer and use it in GitHub Desktop.
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
| initializer : function() { | |
| var client = this.get('client'), list; | |
| this.list = list = new ClientList({ client : client }); | |
| // If this view has a different client, set the list client. | |
| // Inside of your ClientList, you probably want a bit of code that says | |
| // after the clientChange there, load myself... like: | |
| // this.after('clientChange', this.load, this); | |
| this.on('clientChange', function () { list.set('client', e.newVal); }); | |
| // Then, when the ClientList is loaded, it will call render. | |
| list.after('reset', this.render, this); | |
| list.load(); // Initial loading | |
| } | |
| render : function() { | |
| // Typical rendering, and now you can be sure that the ClientList is loaded | |
| // (Unless something else is calling `render`) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment