2012-01-30 2 views
0

나는 그래서 가져 오는거야 모음의 parse 기능을 무시했습니다. 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('reset', this.render);

컬렉션 자체는 컬렉션의 초기화 함수에서 페치 바인딩을 변경하여 작업을 수행 할 수있었습니다. this.collection.bind('add', this.render); 전화 render 4 번.

+0

내 현재의 대답은 문제를 해결하지 않을 수 있습니다. 객체를 가져 오는 위치와'this.total'의 값을 보려고하는 곳에서 더 많은 코드를 게시 할 수 있습니까? –

답변

0

this을 렌더링 기능에 바인딩해야 할 수도 있습니다. 변경 :

this.collection.bind('reset', this.render); 

에 :

this.collection.bind('reset', this.render, this); 
+0

필자는 다음과 같이 언급 했어야했다 :'.bindAll (this, 'render')'before this'' this.collection.bind ('reset', this.render)' – Ari

+0

괜찮 았어. 더 많은 코드를 게시 하시겠습니까? 특히 fetch가 호출되는 곳과 총이 설정되지 않은 문제를 볼 수있는 곳은 무엇입니까? –

관련 문제