derickbailey/backbone.marionette — pull request #55 by redsquare (2012-03-20 15:24:54+00:00)
Title: CollectionView - Allow a view to make a choice where to render a new model item

I have an acitvity feed where I need to be able to add new items in various places in a list. Passing the index of the new model to the appendHtml method would allow the views appendHtml implementation to choose where to render the new item.

E.g currently I am adding a model to a colletion in the following way

activityCollection.add(model, { at: 0 });

this would allow something along these lines

appendHtml: function ($el, html, index) {
$el.append(html);
$(html).insertBefore($el.children().eq(index))
},