How do I alter the ajax POST data and requery
How do I alter the ajax POST data and requery

This is an excerpt of the code I'm using to initialize the datatable:
"serverSide": true,
"ajax": {
'url':'<?= site_url("cp/user/ajax_serverside_users_datatable"); ?>',
'type':'POST',
'data':{
'token': $('#token').val(),
'filter': $('#type').children("option:selected").val(),
},
'dataSrc' : 'data',
},
When the user selects a value in a dropdown, I want to reload the table with the new value in the 'filter' element.
Thanks E.
This discussion has been closed.
Answers
You would use
ajax.data
as a function. This will allow for new values to be used. See the docs for examples.Kevin