Skip to content

Instantly share code, notes, and snippets.

@Panya
Created May 9, 2010 21:32
Show Gist options
  • Save Panya/395433 to your computer and use it in GitHub Desktop.
Save Panya/395433 to your computer and use it in GitHub Desktop.
// main_page.js
tasksList: SC.ScrollView.design({
layout: { top: 30, bottom: 0, left: 0, width: 299 },
hasHorizontalScroller: NO,
contentView: SC.ListView.design({
contentBinding: 'MyApp.tasksController.arrangedObjects',
selectionBinding: 'MyApp.tasksController.selection',
rowHeight: 29,
contentValueKey: 'name',
canEditContent: YES
})
})
// controllers/tasks.js
MyApp.tasksController = SC.ArrayController.create({
content: null,
selection: null
});
// main.js
var firstProject = MyApp.store.find(MyApp.Project, 1),
firstProjectTasks = firstProject.get('tasks');
MyApp.tasksController.set('content', firstProjectTasks);
// and sure i have some fixtures for tasks and projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment