Problem in AJAX POST order variable if serverSide is true and no order setup
Problem in AJAX POST order variable if serverSide is true and no order setup
Dear Allan,
If no order variable is setup, and despite the first column is setup with orderable at false, then the POST order variable indicates by default the column 0. If the column is a technical column not binded to the database, eg. to handle checkbox for selecting rows, then AJAX answers an error "unknow field" on column 0.
I have setup an order in all cases to avoid this problem.
However this is a bug that may create real problems. You can patch it with sending null and avoid any order in this case in PHP, or with a loop in javascript to take the first orderable column instead of 0.
Hoping this report helps.
Regards,
Gilles
Answers
If I understand the comment correctly then I would expect that behavior. By default column 0 is set to order
asc
even if orderable is turned off. Theorder
docs specify this default.. You can useorder: []
ororder: [[X, "asc"]]
(where X is another column) to change the initial order of the table.Kevin
Thanks. My point of view is that this can be considered to be a bug, as sorting on a non sortable column should be handled by design. However this is not major.
Regards,
Gilles