Backbone.js - Correct way of filtering and displaying collection data in a view

前端 未结 3 941
栀梦
栀梦 2020-12-22 16:38

I have got a huge list of tasks loaded on the start.
I want to show them depending on selected list / inbox, so that there won\'t be additional loadings for each list.

3条回答
  •  时光取名叫无心
    2020-12-22 16:52

    I think you need to use another collection. For example, in your inbox, do this:

    inbox: function(){
        currentCollection = new TasksCollection(tasks.inbox());
    }
    

    I haven't tested this but when you do a .reset(); you are removing all your models and loading the ones passed in.

提交回复
热议问题