Data table changes my data order

Data table changes my data order

shaharNardiashaharNardia Posts: 3Questions: 1Answers: 0

Hello, I have a table returning from my data base at a specific order.
for example my columns are - ** id | user | email | age**
and my server side returns this table order by age but the data table will order the table with the first column always.
I know I can use - ----"serverSide": true---- but I would like to keep the sorting, pagination, searching etc at the client side and not use ajax, is there any solution for that?
Thank you very much for your help,
Shahar.

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    You would use order to configure which columns the table is ordered by. By default its column 0.

    Kevin

  • shaharNardiashaharNardia Posts: 3Questions: 1Answers: 0

    Thank you for your reply but it won't fit for my needs, I have a dynamic store procedure that returns db ordered by other column every time...
    I just want the option to print the db table as returned from db and afterwords get the abilities of client side.

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Use the order option Kevin mentioned and set it to be an empty array. That will cause the initial display to be in whatever order the server returned it in.

    Allan

  • shaharNardiashaharNardia Posts: 3Questions: 1Answers: 0

    Thank you very much guys!
    It works :smile:

This discussion has been closed.