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

gboussingboussin Posts: 13Questions: 4Answers: 0

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

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    edited January 2019

    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 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. The order docs specify this default.. You can use order: [] or order: [[X, "asc"]] (where X is another column) to change the initial order of the table.

    Kevin

  • gboussingboussin Posts: 13Questions: 4Answers: 0

    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

This discussion has been closed.