var dT = table.DataTable({
"ajax": { "url": url, "cache": false, "type": "POST" },
"columns": cols,
"serverSide": true,
"cache": false,
"processing": false,
"destroy": true,
"language": {
"emptyTable": "No data available in table",
"info": "Showing _START_ to _END_ of _TOTAL_ entries",
"infoEmpty": "No entries found",
"infoFiltered": "(filtered1 from _MAX_ total entries)",
"lengthMenu": "Show _MENU_ entries",
"search": "Search:",
"zeroRecords": "No matching records found",
search: "_INPUT_",
searchPlaceholder: "Search from below results.",
"paginate": {
"previous": "Prev",
"next": "Next",
"last": "Last",
"first": "First"
}
},
"pageLength": 10,
"pagingType": "bootstrap_full_number",
"dom": "<'row'<'export-tool margin-right-10'>r><'table-scrollable't><'row'<'col-md-4 col-sm-12 margin-top-10'li><'col-md-8 col-sm-12 margin-top-10'p>>", // default layout with horizobtal scrollable datatable
"order": orderDefault, // set first column as a default sort by asc
"fnDrawCallback": function (oSettings) {
alert( 'DataTables has redrawn the table' );
$('#table-region').unmask("");
var totalRecords = oSettings.fnRecordsTotal();
},
});
I am using Datatable with backbone JS. While loading the first page my callback function has been called and data will be rendered in table. When i change page number data comes from server my call back is not called and data is not rerendered.
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.