Viewing 1 replies (of 1 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The quickest way here would be to just sort the table on the “Edit” page, to bring it into the desired default order (just use the sorting arrows near the column header letters).
    Another option would be to use the Table Row Order Extension from https://tablepress.org/extensions/table-row-order/ which can be used to get an initial sorting.

    Now, if you are using the DataTables JS library’s search for the this table on the frontend, and if the column for which you want that initial sort has a non-trivial data type, telling the JS library to perform an initial sort would also be a possibility. For that, you could add something like this to the “Custom Commands” text field on the “Edit” screen of the table:

    "order": [[ 2, 'asc' ]]

    This would initiate an initial ascending sort on the third column of the table (as counting in the code starts with 0).

    Regards,
    Tobias

Viewing 1 replies (of 1 total)
  • The topic ‘Sort by default’ is closed to new replies.