• Resolved wilbert schaapman

    (@wilbertschaapmancom)


    I simply like to order the table by column 1 by default. This column is a pods field number . Is there a simple way to do this?

    The page I need help with: [log in to see the link]

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

    (@tobiasbg)

    Hi!

    Thanks for your post and sorry for the trouble!

    For that, you could maybe try adding this to the “Custom Commands” text field on the table’s “Edit” screen:

    "order": [ [ 0, "asc" ] ]

    This will sort the table upon rendering of the table to the visitor, based on the data that is shown to the visitor (so that it wouldn’t matter where that data comes from).

    Regards,
    Tobias

    Thread Starter wilbert schaapman

    (@wilbertschaapmancom)

    The strange thing is that these custom commands are only available when I have checked the box table header row, which I actually don’t want because I don’t want headers and search options. But anyway, when I fill this in, nothing happens in the default sorting? See images.

    https://ibb.co/9vGMXKc
    https://ibb.co/j4s3235

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    that’s correct. This sorting feature requires a table header row (which can be empty and we could hide it from the visitor with CSS code) and the frontend features to be active. The filtering can also be turned off.

    Your screenshots don’t show what happens to the default sorting, but it would be great if you could post a link to the page with the table here anyways. This allows me to investigate this more easily.

    Note that the Row Order feature module that is part of the TablePress premium versions could also be an option here, depending on the data. This does the sorting on the server, so that no “Custom Command” would be involved and you would not need to hide any undesired header row or filters.

    Regards,
    Tobias

    Thread Starter wilbert schaapman

    (@wilbertschaapmancom)

    It is on my local machine. But it is working if you put on sorting for visitors: .

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yes, sorting must be enabled. But you can hide the header row now. For that, add this to the “Custom CSS” text area on the “Plugin Options” screen of TablePress:

    .tablepress-id-123 thead {
      display: none;
    }

    where 123 is the table ID.

    Regards,
    Tobias

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

The topic ‘TablePress default sorting’ is closed to new replies.