• Resolved nittygrittytechy

    (@nittygrittytechy)


    Hello,

    Before I purchase this plugin, I am having a problem and need help please.
    https://tablepress.org/extensions/table-row-order/

    I uploaded this plugin added the short code.

    [table id=4 row_order=reverse responsive=collapse responsive_breakpoint=”phone” /]

    However, it is not in order by date. I’m not sure what column it is using to be in reverse order.

    I would like the date column to be in order, so that would be in ascending order since I am using google sheets to upload the data. In google sheets, the new content is added at the bottom, which is not 1.

    Would this plugin work for me or do I need to add a command code?

    Thank you

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This Shortcode parameter from the Row Order Extension shows the table in reversed order from that on the “Edit” screen. It does not do any sorting. (Sorting is possible with other parameters, but not directly for dates, due to the various possible formats.)
    I would therefore indeed recommend a JS-based sorting, via a “Custom Command”. To find that, 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

    Thread Starter nittygrittytechy

    (@nittygrittytechy)

    Sorry for the late reply.

    Okay great, here is my link.
    https://livinghisword.org/daily-biblical-news/

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for the link!

    To automatically sort by these dates, please add this to the “Custom Commands” text field:

    "order": [ [ 5, "desc" ] ]
    

    This will sort by the sixth column (counting the columns starts with 0), in descending order. To get ascending order, use "asc" in the code.

    Regards,
    Tobias

    Thread Starter nittygrittytechy

    (@nittygrittytechy)

    Thank you for this code, however it is still not sorting correctly. The next date, after 3-23-22, should be 11-5-2021 and then 11-3-2021 and so forth.

    Am I doing something wrong?

    Thank you

    https://livinghisword.org/daily-biblical-news/

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ok, it looks like the format auto detection is not working properly. We might just have to manually set the data type to “date” for that column. To achieve that, please change the full “Custom Command” to

    "columnDefs": [ { "className": "none", "targets": [ 1, 2, 3, 4 ] }, { "type": "date", "targets": [ 5 ] } ], "order": [ [ 5, "asc" ] ]
    

    Regards,
    Tobias

    Thread Starter nittygrittytechy

    (@nittygrittytechy)

    Whoohoo, it finally works. Thank you sooooooooo much!!!!!!!!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

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

    Best wishes,
    Tobias

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

The topic ‘Sorting Order Plugin Question’ is closed to new replies.