how to change format of output
how to change format of output
Hello, we know datatables send output with this format:
columns[0][data]= first_name
columns[0][name]=
columns[0][searchable]= true
columns[0][orderable]= true
columns[0][search][value]=
columns[0][search][regex]= false
but I need this format for output:
columns[0].data= first_name
columns[0].name=
columns[0].searchable= true
columns[0].orderable= true
columns[0].search.value=
columns[0].search.regex= false
How to can change format in datatables.net JQuery ?
Thanks
This question has an accepted answers - jump to answer
Answers
Use
ajax.data
to change the format of the request sent to the server. Are you asking to change the format to JSON? If yes then see the last example in theajax.data
docs. Otherwise useajax.data
as a function to change to the desired format.Kevin
I can't understand. can you show me an example?
sure JSON is good...
but I want to send data with request parameter
.../pagination?draw=1&columns[0].data=first_name&...
I need an example for it
thanks
As I said the last example in the
ajax.data
docs show how to convert the request to JSON. Here is the code from the example:Kevin
Thank you very much
Can I send data looks like this ? (parameter request)
You will need to use
ajax.data
as a function to manipulate the original format sent to the server to the format you want. There is nothing built into Datatables to convert the default parameters to the format you want.Kevin
Thank you dear
I have to remove [] and send them.
thanks a lot