我重寫的集合,我取的這樣的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