Created
December 11, 2012 19:55
-
-
Save alejandroiglesias/4261572 to your computer and use it in GitHub Desktop.
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
var View = Base.extend({ | |
initialize: function () { | |
console.log('view init'); | |
if ( ! this.el) { | |
this.el = this.el || document.createElement(this.tagName); | |
} | |
} | |
}); | |
var FilterListView = View.extend({ | |
tagName: 'ol', | |
initialize: function (props) { | |
View.prototype.initialize.call(this, props); | |
console.log('filter list view init'); | |
this.constructor.prototype.initialize(); | |
$.extend(this, props); | |
$(this.model).on('reset', $.proxy(this.render, this)); | |
}, | |
render: function (eventName) { | |
console.log('FilterListView::render()', this.model.models, eventName); | |
_.each(this.model.models, function (filter) { | |
$(this.el).append(new FilterListItemView({ model: filter }).render().el); | |
}, this); | |
return this; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment