Skip to content

Instantly share code, notes, and snippets.

@topherfangio
Created March 1, 2011 21:04
Show Gist options
  • Save topherfangio/849887 to your computer and use it in GitHub Desktop.
Save topherfangio/849887 to your computer and use it in GitHub Desktop.
Basic code for creating a TemplateCollectionView
Pharos360.main = function main() {
Pharos360.getPath('mainPage.mainPane').append();
Pharos360.studentsController.set('content', Pharos360.store.find(Pharos360.Student));
};
function main() { Pharos360.main(); }
...
detailView: SC.ScrollView.design({
layout: { top: 10, bottom: 10, left: 251, right: 10 },
hasHorizontalScroller: NO,
backgroundColor: 'white',
contentView: Pharos360.StudentsListView.design({
layout: { top: 0, left: 0, right: 0, bottom: 0 }
})
})
...
Pharos360.studentsController = SC.ArrayController.create(
/** @scope Pharos360.studentsController.prototype */ {
// TODO: Add your own code here.
}) ;
{{#collection "Pharos360.StudentsListView"}}
<div>{{bind "length"}}</div>
{{/collection}}
Pharos360.StudentsListView = SC.TemplateCollectionView.extend(
/** @scope Pharos360.StudentListView.prototype */ {
templateName: 'students_list',
contentBinding: 'Pharos360.studentsController'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment