Can I get the latest ItemView from a Backbone CompositeView? I found a lot of documentation to get the latest model in the collection, but not the last view in the collection of views.
The reason I would like to do this is because I can make the last row in the table a little differently.
Below is the code that I'm using right now, it works fine, but it would be less “hacked” if I could get the correct ItemView from the CompositeView that created and displayed it. It uses jQuery to search for the entire part of the DOM contained in the CompositeView for the last element, then manipulates that element.
B.ListControl.View = Backbone.Marionette.CompositeView.extend({ itemView: ..., itemViewContainer: ..., template: ..., // ON RENDER onRender: function(){ // Add button to the last element in the list this.$el.find('div:last').text('Custome stuff goes here'); } });
Thanks!
source share