Custom Server Side Parameters
Custom Server Side Parameters

I am trying to integrate DT with my existing search function - it seems that you can't customize DT to return alternate parameters: i.e. search[value] etc. In my case it would be much easier if I could change that to 'q' for example.
If you can change the default paramater keys returned please advise.
I wanted to try this (https://datatables.net/reference/option/ajax.data):
ajax: {
url: $('#locations').data('source'),
type: 'GET',
data: {
q: 'search value'
}
Where 'search value' is just a clone of the 'search[value]' parameter but I seem to be at a loss how to access this. Can you do it direct from DT or do I need to look it up from the DOM etc?
This question has accepted answers - jump to:
Answers
Here is a server side example of modifying the parameters sent.
Kevin
Perfect - that was in the link I provided but had not tried that one yet (was not obvious to me based on my limited JS background). Thanks!
Follow-up question - is it possible to retrieve the other form data such as length and start? In my case I want to send the
length
aslimit
andstart
asoffset
.The
d
parameter passed into the function has all the parameters. You should be able to use something liked.start
. You can useconsole.log(d)
in the function to see the structure.Kevin
Ahhh. Ok that should do the trick ?