Created
December 19, 2012 20:22
-
-
Save mattd/4340132 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
define([ | |
'marionette', | |
'collections/client/tab', | |
'views/tab/model' | |
], function (Marionette, TabCollection, TabModelView) { | |
"use strict"; | |
return Marionette.CollectionView.extend({ | |
initialize: function (options) { | |
this.setSelected(options.id); | |
this.on('itemview:click', this.setSelected); | |
}, | |
collection: new TabCollection([ | |
{id: 'learners', text: 'Learners Tab'}, | |
{id: 'groups', text: 'Groups Tab'} | |
]), | |
itemView: TabModelView, | |
tagName: 'ul', | |
setSelected: function (id) { | |
this.collection.set('selected', childView.model.id); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment