Skip to content

Instantly share code, notes, and snippets.

@mauritslamers
Created October 7, 2008 21:15
Show Gist options
  • Save mauritslamers/15389 to your computer and use it in GitHub Desktop.
Save mauritslamers/15389 to your computer and use it in GitHub Desktop.
<%= container_view :my_container_view,
:bind => {
:content => 'myApp.containerViewController.property'
}
%>
myApp.containerViewController = SC.ObjectController.create(
/** @scope Admissionexam.examFormController */ {
// TODO: Add your own code here.
contentBinding: 'myApp.viewSelectionController.selection'
}) ;
{
guid : 1,
name : '_view_one',
view : 'viewnametodisplay_one',
type : 'Model'
},
{
guid : 2,
name : '_view_two',
view : 'viewnametodisplay_two',
type : 'Model'
},
myApp.Model = SC.Record.extend(
/** @scope myApp.Model.prototype */ {
iconClassName: 'sc-icon-folder-16',
localised_name: function(){
var name = this.get('name');
if((name) && (name != "")){
return name.loc();
}
else {
return name;
}
}.property('name'),
editView: function(){
var viewname = this.get('view').dasherize().camelize();
return SC.page.get(viewname);
}.property('view'),
// TODO: Add your own code here.
properties: [ 'id', 'name', 'view']
}) ;
<% view :viewnametodisplay_one do %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment