I create a second tbodyin my table and simply move all the rows that I need to save in the following tbody, for example:
initComplete: function() {
var self = this;
var api = this.api();
api.rows().eq(0).each(function(index) {
var row = api.row(index);
if (row.data()...) {
var $row_to_persist = $(row.node());
var $clone = $row_to_persist.clone();
$(self).find('tbody:last').append($clone);
$total_row.remove();
row.remove();
api.draw();
}
});
}
source
share