draw Datatable after Date range
draw Datatable after Date range
Hi,
i am having problem datatable draw after date range. by default i am loading current moth data into table. if user select a date range. i send a query request to PHP script to get the specified date range data. i am getting data from server in following format.
when i use table.rows.add().draw() it is not adding the newly data into table.
[["2017-02-02 00:19:15","000201068","240xxxxxxx","4","D2C-EXTEN","Taxi"],["2017-02-02 00:24:51","000201068","247xxxxxxx","13","D2C-EXTEN","Taxi"],["2017-02-02 00:37:59","000201058","206xxxxxxx","31","D2C-EXTEN","Taxi"]]
here is my ajax call
$("#end_date").on('change', function (){
var start_date = $('#start_date').val();
var end_date = $('#end_date').val();
table.clear();
$.ajax({
"type": "POST",
"url": "recordsdate.php",
"data": {start_date: start_date,
end_date: end_date,
},
success: function (data){
console.log(data);
table.rows.add(data).draw();
}
});
});