我可以得到它的模型集合嗎?我想獲得一組模型來計算相對於當前模型的前後模型。它可以在骨幹中完成嗎?骨幹:我可以找到它的模型集合嗎?
var PhotoView = Backbone.View.extend({
className: "media-item",
template: _.template(photoItemTemplate),
render: function(){
var data, next;
data = this.model.toJSON();
this.$el.html(this.template(data));
return this;
},
prev: function() {
//this.model.collection = ??
},
next: function() {
//this.model.collection = ??
}
});
prevModel === undefined如果collection.indexOf(this.model) - 1是負數 – isqad 2013-03-06 14:42:51