Backbone.Marionette CollectionExibir retorno de chamada quando todos os itemViews tiverem terminado a renderização?
Estou usando a marioneteLayout
.show
para renderizarCollectionView
e queria saber se há uma maneira de detectar quandotodos aItemView
as crianças terminaram de renderizar?
Uma versão simplificada do meu código é:
Layout
Layouts.Group = Backbone.Marionette.Layout.extend({
template: Templates.group,
...
regions: {
header: ".group-header"
details: ".group-details"
},
...
});
CollectionView
Views.GroupDetail = Backbone.Marionette.CollectionView.extend({
itemView: groupDetailRow,
...
onRender: function () {
// do something here after rendering *all* groupDetailRows of information for group detail section
}
});
ItemView
Views.GroupDetailRow = Backbone.Marionette.ItemView.extend({
onRender: function () {
// single groupDetailRow of information
}
});
.exposição
var details = new Views.GroupDetail();
details.show(new DV.Time.Views.GroupDetail());
Notei nos documentos que há menção de um.done
função:
new MyCollectionView().render().done(function(){
// all of the children are now rendered. do stuff here.
});
É possível usar isso com oLayout
?