Created
March 24, 2011 17:01
-
-
Save topherfangio/885426 to your computer and use it in GitHub Desktop.
Partially working example of using SC.TemplateView inside of an SC.ContainerView
This file contains 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
// Run this in your console/code. | |
MyApp.mainPage.getPath('mainPane.containerView.testContainerView').set('nowShowing', "MyApp.testView"); |
This file contains 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
MyApp.ContainerView = SC.View.extend({ | |
childViews: 'testContainerView'.w(), | |
testContainerView: SC.ContainerView.extend({ | |
layout: { height: 0, bottom: 0, left: 0, right: 0 }, | |
contentView: SC.LabelView.extend({ | |
layout: { top: 0, bottom: 0, left: 0, right: 0 }, | |
value: 'Test' | |
}) | |
}) | |
}) |
This file contains 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
MyApp.testView = SC.TemplateView.create({ | |
templateName: 'testHandlebarsView', | |
}); | |
MyApp.testCollectionView = SC.TemplateCollectionView.create({ | |
content: [ {firstname:'Tom'}, {firstname:'Yehuda'} ] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment