I have problems when using fnUpdate it jump to page 1, then I use fnStandingRedraw but it is not working properly, it returns the first cell of the row update is [object Object]
P/s : CODE
var data_json = $('#data_json_div').html();
var data = $.parseJSON(data_json);
window.table = $('#zero-configuration').dataTable( { "dom": 'C<"clear">lfrtip<"clear spacer">T', "colVis": { "exclude": [ 0 , 1 ], "align": "right", }, "deferRender": true, "processing": true, "order": [[ 0, "desc" ]], "data": data, "columns" : [ { "data" : "id" }, { "data" : "callback_status" }, { "data" : "date" }, { "data" : "weekday" }, ], "bPaginate": true, "bLengthChange": true, "bFilter": true, "bSort": true, "bInfo": true, "bAutoWidth": true, "scrollX": true, "scrollY": "500px", "scrollCollapse": true, "paging": true, "sPaginationType": "full_numbers", "lengthMenu": [[5,10, 100, 300, -1], [5,10, 100, 300, "All"]], "stateSave": true, });
new $.fn.dataTable.FixedColumns( table , { leftColumns: 2, });
table.fnUpdate({ "id": data[0].id , "callback_status": data[0].callback_status "date": data[0].date , "weekday": data[0].weekday , },$('tr.proessing'),0,false)
table.fnStandingRedraw();
It looks like you're new here. If you want to get involved, click one of these buttons!
Answers
P/s : CODE
var data_json = $('#data_json_div').html();
var data = $.parseJSON(data_json);
window.table = $('#zero-configuration').dataTable( {
"dom": 'C<"clear">lfrtip<"clear spacer">T',
"colVis": {
"exclude": [ 0 , 1 ],
"align": "right",
},
"deferRender": true,
"processing": true,
"order": [[ 0, "desc" ]],
"data": data,
"columns" : [
{ "data" : "id" },
{ "data" : "callback_status" },
{ "data" : "date" },
{ "data" : "weekday" },
],
"bPaginate": true,
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": true,
"bAutoWidth": true,
"scrollX": true,
"scrollY": "500px",
"scrollCollapse": true,
"paging": true,
"sPaginationType": "full_numbers",
"lengthMenu": [[5,10, 100, 300, -1], [5,10, 100, 300, "All"]],
"stateSave": true,
});
new $.fn.dataTable.FixedColumns( table , {
leftColumns: 2,
});
table.fnUpdate({
"id": data[0].id ,
"callback_status": data[0].callback_status
"date": data[0].date ,
"weekday": data[0].weekday ,
},$('tr.proessing'),0,false)
table.fnStandingRedraw();