-
-
Save geoffreyd/857921 to your computer and use it in GitHub Desktop.
Connecting Array controller, Statechar and view
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
Pharos360.labelsController = SC.ArrayController.create( | |
/** @scope Pharos360.labels.prototype */ { | |
// TODO: Add your own code here. | |
}) ; |
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
/* | |
* This is the portion of the Ki state that sets up the labels' store. | |
*/ | |
enterState: function() { | |
/* | |
* Normally we'd start talking to the server and setup a callback that would | |
* fire when the data was received (or we'd observe the datastore and wait for the | |
* data to be available). Since this is just a fixtures DataStore...we won't worry | |
* about that currently. | |
*/ | |
var coursesStore = Pharos360.store.find(Pharos360.Course); | |
var labelsStore = Pharos360.store.find(Pharos360.Label); | |
if (coursesStore != null && labelsStore != null) { | |
// Setup the controllers | |
Pharos360.coursesController.set('content', coursesStore); | |
Pharos360.labelsController.set('content', labelsStore); | |
// Show the UI | |
Pharos360.getPath('mainPage.mainPane').append(); | |
} else { | |
console.log('An error occured while attempting to load the course/label information.'); | |
} | |
}, |
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 your main_page.js, where you actually use the view, is where you should create any of the bindings. | |
// ScrollView is designed to take a 'contentView' and scroll it, that's all. | |
navView: SC.ScrollView.design({ | |
contentView: Pharos360.NavigationView.design({ | |
labelsBinding: 'Pharos360.labelsController.arrangedObjects' | |
}) | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment