Open nikhilkarmude opened 9 years ago
take a look at this one
https://github.com/alfajango/jquery-dynatable/issues/162#issuecomment-65770248
I looked over it, and tried many possibilities with the "settings" parameters but the new records seem to be appended to the older records. Is there any other work around?
Are yout sure that "dynatable.process();" does what you expect it do to? Your are chaining the commands before so that var "dynatable" should contain the return value of ".data('dynatable')" - or am i completly wrong here?!
here are 2 functions that i am using in a project // function addRow(table,DS){
// bisher vorhandene DS
table.data('dynatable').settings.dataset.originalRecords.push(DS);
table.data('dynatable').process();
}
function delRow(table,DS){
var bis = table.data('dynatable').settings.dataset.originalRecords;
var neu = [];
$.map(bis,function(val, i){
if(val.key != DS.key){
neu.push({'key': val.key, text:val.text });
}
})
table.data('dynatable').settings.dataset.originalRecords = neu;
table.data('dynatable').process();
}
I want to know how do I clear(remove all records) the table before I insert new records in table. Currently, the table is appending new records to the previous records.
My code: response = $.parseJSON(data);