backbone.js - Refresh a jQuery dataTable after Backbone collection change -


i have view creates datatable's row template inside render function:

render: function(){      this.collection.fetch({async:false});     var tmpl = _.template(this.template);     var = this;     _.each(this.collection.tojson(), function(item) {         $(that.el).append(tmpl(item));     });      return this;  }, 

after initialize datatable this:

  $("#idtable").datatable(); 

i have view after modify/add model of collection calls time render redraw datatable. modified/added row appears correctly in table, if use pagination or search box modified/added row disappears , appears old one.

how can refresh datatable???

i found way: how tell datatables check updated data in backbone collection? , need create datatables undercore's template.

this answered before. try links below

http://datatables.net/forums/discussion/75/is-it-posible-to-refresh-table/p1

how refresh jquery datatable after deleting row

how reload datatable(jquery) data?

how can refresh datatable (jquery) after adding data database spring mvc?

reload/refresh datatable

how reload/refresh jquery datatable?

how refresh datatables


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -