i want to update data in DataTable without lossing old data ..please provide any methods availblefor
i want to update data in DataTable without lossing old data ..please provide any methods availblefor
anand825
Posts: 1Questions: 1Answers: 0
I am using this code but old data i am lossing
function loadTabledata(val){ var dataval='empdata.json'; if(val == '2'){ alert(val); $('#empTable').dataTable().fnDestroy(); // $('#empTable').empty(); var dataval='empdata2.json'; } $.ajax({ type: "post", url: dataval, data: {}, contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { console.log(data); var myData = data;//jQuery.parseJSON(JSON.stringify(data));//JSON.parse(data); console.log(myData); $.fn.DataTable.ext.pager.numbers_length = 10; var tabledata=$('#empTable').DataTable({ "data": myData, "pagingType":"full_numbers_no_ellipses", "columns": [ { "data": "name" }, { "data": "designation" }, { "data": "office" }, { "data": "extension" }, { "data": "joining_date" }, { "data": "salary" } ] }); } }); }This discussion has been closed.