骨干网可以使以相反的顺序集合? [英] Can Backbone render a collection in reverse order?
本文介绍了骨干网可以使以相反的顺序集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是Signalr枢纽订阅服务器上的事件。什么事件被分配到一个枢纽,它的成功添加该项目以木偶的CollectionView。这,反过来,呈现到表
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 turn, is rendered to a table.
由于事件表本质上是一个记事簿,我想以相反的顺序和$ P $事件pferably只保留事件的正数。
Because the table of events is essentially a blotter, I'd like the events in reverse order and preferably only keep n-number of events.
骨干能自动以相反的顺序重新渲染的集合?
Can Backbone 'automatically' re-render a collection in reverse order?
推荐答案
要通过集合中的相反顺序我通常使用一个建筑是这样的:
To go through collection in the reverse order I usually use a construction like this:
_.each(collection.last(collection.length).reverse(), function(model){ });
这篇关于骨干网可以使以相反的顺序集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文