I am using Datatables to display tabular data in my Web application, and have configured it to make use of server-side processing, i.e. query the server via AJAX for filtered data. I want to filter according to additional parameters that are specific to my application, i.e. corresponding to some user options (f.ex. via a checkbox in the UI). How do I make DataTables pass these additional filter parameters to the server?
Dynamic parameter, This one is working for me, seems best solution
t = $("#tbl_SearchCustomer").DataTable({
processing: true,
serverSide: true,
info: true,
ajax: {
url: '../Data/SearchCustomer',
data: function (data) {
data.CustomerCategoryID = $("#CustomerCategoryID").val(); // dynamic parameter
delete data.columns;
}
},
deferRender: true,
columns: [
{ "data": "FullName" },
],
dom: 'lfrtip'
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With