Change custom HTTP params with JS
Change custom HTTP params with JS
I would like to use custom HTTP variables http://datatables.net/examples/server_side/custom_vars.html to create external custom filtering buttons for server side data source. I know how to initialize datatable with custom variables it works well:
$('table.dataTable').dataTable({
serverSide: true,
ajax: {
data: {
filters: {
status_id: 2
}
}
},
}
But how can I change that custom variable (filters: {status_id: 2}
) after initialization?
I've tried:
$('table.dataTable').DataTable().ajax.data = {filters: {status_id: 8}}
and
$('table.dataTable').DataTable().data({filters: {status_id: 8}})
but this doesn't work as I expected.