Please explain each and every line (after DataTable({ from the segment of the code given below
Please explain each and every line (after DataTable({ from the segment of the code given below
$(function () {
$('#listAllProducts').DataTable({
'processing' : true,
'serverSide' : true,
'searching' : false,
'ordering' : false,
"ajax" : {
'url' : 'manage-new-products',
'data' : function(d) {
d.param1 = $('#param1').val();
//d.param2 = $('#param2').val();
}
},
'dataSrc' : "",
'columns' : [ {
'data' : 'productid' //productid,etc., are contained in a database
}, {
'data' : 'productname'
}, {
'data' : 'productstatus'
}, {
'data' : 'action'
}
]
});
});
//Method For Searching Records In The List
function searchData() {
$('#listAllProducts').DataTable().draw();
}
Answers
The best place to look is at the Options Documentation. If you have specific questions let us know.
Kevin
What is the role of the function(d) in 'data': ?
That is explained in the
ajax.data
docs. Take a look at the examples in the dcos.Kevin