Changing the params on an AJAX sourced table
Changing the params on an AJAX sourced table
jLinux
Posts: 981Questions: 73Answers: 75
I have a table that uses the ajax
feature to retrieve the data. Above the table, there's a search form, and when someone submits a search, I wanted to have the DataTable re-query the AJAX source, but with different parameters.
I see there's an ajax.params()
feature, but that looks like its only for retrieving the parameters, not setting new ones.
It looks like I can do something like:
table.ajax.url( 'ajax-data.php?company_id=1291' ).load();
But I hate having to do that, its just... UGLY!
Thanks!
This discussion has been closed.
Answers
ajax.data
is the way to send parameters to the server. You can have it as a function that will use a variable that has been set somewhere else.Allan