• Resolved drucken25

    (@drucken25)


    The data I generate for my table is not sorted. A user can obviously sort the table, but is there a way to specify automatic sorting to take place whenever the table data is updated (in my case this is done via auto-import), e.g. “sort by column x, descending”?

    https://ww.wp.xz.cn/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    You have two options here. One (probably the better one), is to use the Table Row Order Extension from http://tablepress.org/extensions/table-row-order/ which sorts before sending the data to the user.

    The other would be to initiate a sort on the desired column once the table was loaded by the user’s browser. For that, you’d have to add a “Custom Command” like

    "order": [ 2, 'desc' ]

    into the corresponding text field on the table’s “Edit” screen.
    The 2 in the example would initiate the sort on the third column, as counting the columns starts with 0 in the code. Thus, just adjust that number as desired.

    Regards,
    Tobias

    Thread Starter drucken25

    (@drucken25)

    Thanks Tobias,
    quick and efficient answer.
    I did go with your extension, works well.
    Btw, I could not find it when I clicked add new plugin in the WP dashboard.
    Best,
    Gerhard

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    That Extension (and all the others) are not part of the WordPress plugin directory, which is why you can’t find them via that search.

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘automatic sort’ is closed to new replies.