The best way to sort a collection in a CompositeView

后端 未结 3 1019
旧巷少年郎
旧巷少年郎 2021-02-19 06:45

I am trying to sort a collection in a Marionette.CompositeView.
I have a collection which looks like this:

[
   {id: 1, name: \'bar\'},
           


        
3条回答
  •  抹茶落季
    2021-02-19 07:33

    I believe the Marionette guys are considering building this into Marionette, but until that time, I've build a little mixin called Sorted which you can mix into your CollectionView and CompositeView classes. It's been heavily used in a production environment for Gitter for a long time and we find it works very well..

提交回复
热议问题