I need to render only first element of fetched collection.
ItemView = Backbone.Marionette.ItemView.extend({
template: "#item"
});
ItemsEmptyView = Backbone.Marionette.ItemView.extend({
template: "#items_empty"
});
ItemsView = Backbone.Marionette.CompositeView.extend({
template: "#items",
itemView: ItemView,
emptyView: ItemEmptyView
});
How can I accomplish that? I've tried to override render()
method, or onBeforeRender()
nothing helps.