Clear dynamic records before new update
I am using a plugin dynatable
. I want to know how to delete (delete all records) a table before I insert new records into the table. The table is currently adding new records to previous records.
My code:
response = $.parseJSON(data);
var dynatable = $('#printIDs').dynatable({
dataset : {
records : response
}
}).data('dynatable');
dynatable.settings.dataset.originalRecords = response;
dynatable.process();
+3
source to share
1 answer
I had problems with this. My last code looked like this:
var getAuditRecords = function (requestUrl) {
$.ajax({
url: requestUrl,
dataType: "json",
}).done(function (response) {
var dynatable = $('#auditTable').dynatable({
dataset: {
records: response
}
}).data('dynatable');
dynatable.settings.dataset.originalRecords = response;
dynatable.process();
});
};
+3
source to share