Created
February 1, 2012 18:56
-
-
Save sevifives/1718649 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
SC.ListItem.extend({ | |
contentBinding: SC.Binding.from('YourApp.yourDynamicArrayController'), | |
exampleView: YourApp.CustomListItemView.extend({ | |
staticDataBinding: SC.Binding.oneWay('YourApp.yourStaticDataController') | |
}) | |
}) | |
YourApp.CustomListItemView = SC.ListItemView.extend({ | |
staticData: null, | |
createChildViews: function () { | |
var content = this.get('content'); // this is the content from the dynamic controller | |
var staticData = this.get('staticData'); // this is the data from the static controller | |
var kids = []; | |
var label = this.createChildView(SC.LabelView, { | |
titleBinding: SC.Binding.from('value',content) | |
}); | |
kids.push(label); | |
var somethingStatic = this.creatChildView(SC.LabelView, { | |
titleBinding: SC.Binding.from('property',staticData) | |
}); | |
kids.push(somethingStatic); | |
this.set('childViews',kids); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment