Skip to content

Instantly share code, notes, and snippets.

@mattd
Created December 19, 2012 20:22
Show Gist options
  • Save mattd/4340132 to your computer and use it in GitHub Desktop.
Save mattd/4340132 to your computer and use it in GitHub Desktop.
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