Skip to content

Instantly share code, notes, and snippets.

@etgryphon
Created July 29, 2009 00:53
Show Gist options
  • Save etgryphon/157788 to your computer and use it in GitHub Desktop.
Save etgryphon/157788 to your computer and use it in GitHub Desktop.
myApp.MasterView = SC.View.extend(
/** @scope myApp.MasterView.prototype */ {
classNames: ['master-view'],
// necessary config elements to set up binding on the ListViews
contentPath: '',
selectionPath: '',
/**
Current Layouts for all movable
*/
createChildViews: function() {
var childViews = [], view, currPosHeight;
//Add the search text field
view = this.createChildView(
SC.TextFieldView.design({
layout: {/* layout here */},
valueBinding: this.get('searchPath')
}),
{ rootElementPath: [0] }
);
childViews.push(view);
view = this.createChildView(
SC.ListView.design({
layout: { /* layout here */ },
contentValueKey: 'name',
contentBinding: this.get('contentPath'),
selectionBinding: this.get('selectionPath'),
}),
{ rootElementPath: [1] }
);
childViews.push(view);
this.set('childViews', childViews);
},
/* Do special Stuff */
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment