Answer the question
In order to leave comments, you need to log in
How to redraw a view in MarionetteJS?
Guys, tell me how to redraw the view when added to the collection
define([
'marionettejs',
'text!templates/tables/reports/reports-list.hbs',
'collections/tables/reports-list',
'db/reports-list'
],
function (MarionetteJS, ReportsListTPL, ReportsListCollection, ReportsListDB) {
'use strict';
return Backbone.Marionette.ItemView.extend({
template: _.template(ReportsListTPL),
collection: new ReportsListCollection(ReportsListDB),
tagName: 'ul',
initialize: function () {
this.collection.on('add', this.render)
}
});
})
App.reportsListView.collection.add({name: nameInput, id: data.id});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question