我重写的集合,我取的这样的parse
功能:获取并解析收藏
parse: function(response) {
this.total = response.total;
return response.items;
}
而且,我已经绑定的集合,使用它的视图的渲染功能。 this.collection.bind('reset', this.render);
集合本身是集合的初始化函数获取: this.collection.fetch({ data: params });
收集,然后在子视图访问:
render: function() {
var catalog, pages;
catalog = new App.Views.Catalog({collection: this.collection});
pages = new App.Views.Pages({collection: this.collection});
return this;
}
注:
的只有我的方式可以得到它的工作是通过更改绑定到:this.collection.bind('add', this.render);
,其结束拨打render
四次。
我现在的答案可能不会解决问题。你可以在获取对象的地方发布更多的代码,以及试图查看'this.total'的值吗? – 2012-01-30 19:11:46