menacingly
menacingly

Reputation: 738

How to handle multiple marionette CollectionViews sharing the same collection

I've got a single page that needs to show multiple little boxes of the same collection sorted different ways.

Is there an event I can use to sort the collection just before rendering and use the same collection in all of the CollectionViews? Or should I make N copies of the collection sorted different ways and wire up the events myself?

I'd really like for all of the views to update when I add/remove an item from the collection.

Upvotes: 1

Views: 47

Answers (1)

antejan
antejan

Reputation: 2624

CollectionView allows for a custom viewComparator option if you want your CollectionView's children to be rendered with a different sort order than the underlying Backbone collection uses.

Upvotes: 1

Related Questions