Support » Plugin: TablePress » Wishlist – Auto sort by specific column

  • Resolved hackrepair

    (@hackrepair)


    Ask me what feature I would most like to see in TablePress?

    I wish I could import a table
    and have an option for it to auto-sort a specific column upon the page loading.

    Christmas present maybe?

    • This topic was modified 1 year, 8 months ago by hackrepair.
    • This topic was modified 1 year, 8 months ago by hackrepair.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    How about already possible?! 🙂

    Just add this to the “Custom Commands” text field on the table’s “Edit” screen:

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

    This example would sort the second column (counting starts with 0) in ascending order when the page where the table is shown is loaded. Just change the column number as necessary (remember to subtract 1) and set either asc or desc for the sort order.

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    that looks good. Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the link! It seems that the two tables on this page don’t have the “Custom Command”. Are you sure that you added it to the correct tables?

    Regards,
    Tobias

    I suppose we need to take this off the forum so we can discuss access so you can log in. Best method?

    Thanks!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ok. Please send me an email, the address is in the main plugin file “tablepress.php”.

    Regards,
    Tobias

    Ok, I got that working.
    And I figured out the descending order is:

    “order”: [[ 1, ‘desc’ ]]

    Thanks again!

    • This reply was modified 1 year, 8 months ago by hackrepair.
    Plugin Author TobiasBg

    (@tobiasbg)

    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!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Wishlist – Auto sort by specific column’ is closed to new replies.