Hi,
thanks for your question, and sorry for the trouble.
For this to work, sorting must be enabled for that table, by enabling the checkbox on the “Edit” screen. Can you please try that?
Now, if you then want to prevent the visitor from sorting the table, you could try turning that off by adding this to the “Custom Commands” as well:
"order": [[ 4, 'asc' ], [ 5, 'asc' ]], "columnDefs": [ "orderable": false, "targets": "_all" ]
Regards,
Tobias
Thank you very much Tobias! Enabling table sorting without the columnDefs command works perfectly. However it does not work with the columnDefs command.
I also noticed that the columnDefs disabled paging.
Does table sorting have to be enabled to use the Table Row Order extension?
-
This reply was modified 5 years, 9 months ago by
Tim Burkart. Reason: correction
Here’s what I have concluded:
Table sorting must be enabled for both the Table Row Order extension and the order command.
Using columnDefs command to disable any column sorting capability causes the above not to work.
Using columnDefs command to disable all column sorting disables table paging.
I am moving forward with the order command to sort two columns.
Thank you for your help!
Hi,
ah, sorry, I made a mistake in that command. Please try again with
"order": [[ 4, 'asc' ], [ 5, 'asc' ]], "columnDefs": [ { "orderable": false, "targets": "_all" } ]
(Note the extra { and }.)
Regards,
Tobias
This is awesome! Thank you very much for the correction! It works perfectly.
Best regards,
Tim
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!