Order columns JSON server side
Order columns JSON server side
I use datatable with dynamic columns from server side. When I reorder the columns the data is reorder but when I do a callback the columns are in the correct order but the data are in the original secuence because in server side I return the JSON in the same order.
How can I resolve this? Can I return in JSON column name and value (I try this but datatable show me an alert JSON error)?
How can I resolve this? Can I return in JSON column name and value (I try this but datatable show me an alert JSON error)?
This discussion has been closed.
Replies
Also consider using objects, rather than arrays, which will make ordering irrelevant: http://datatables.net/blog/Extended_data_source_options_with_DataTables
Allan
If is possible I post this values and reorder the JSON data.
First time I have this columns order: 0,1,2,3,4
When I reorder the columns: 2,3,1,4,0
If I post this numbers I can reorder the JSON.
Allan