backbone.js collection get vars

后端 未结 4 2024
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 20:28

This seems like an obvious one, but I\'m somehow missing it...

How do you send options along with a backbone.js collection fetch()?

Or, from a broader point of

4条回答
  •  花落未央
    2021-01-31 21:08

    You can add an id to the url that can be used by the server to make a selection of the data send. E.g.

        var EventsCollection = Backbone.Collection.extend({
    
            model: Events,
    
        });
    
        var eventCollection = new EventsCollection();
        eventsCollection.url = 'foo?offset=10&limit=20';
        eventsCollection.fetch();
    

提交回复
热议问题