Can Backbone render a collection in reverse order?

后端 未结 8 1558
猫巷女王i
猫巷女王i 2021-02-09 04:19

I\'m using a Signalr hub to subscribe to events on the server. What an event is dispatched to a hub, its successfully adding the item to a Marionette CollectionView. This, in

相关标签:
8条回答
  • 2021-02-09 04:52

    To go through collection in the reverse order I usually use a construction like this:

    _.each(collection.last(collection.length).reverse(), function(model){ });
    
    0 讨论(0)
  • 2021-02-09 04:54

    If you use lodash instead of underscore you can also do this:

    _(view.collection.models).reverse();
    
    0 讨论(0)
提交回复
热议问题