• Resolved pczjrh

    (@pczjrh)


    Hi,
    I’ve got tables that I’d like to sort by date. the data is formatted as 01/01/2022 in each cell in column 2 (i.e. the second one).
    If I add any of the suggested sorting code such as

    “columnDefs”: [ { “type”: “date-eu”, “targets”: [ 1 ] } ]

    the sorting on all tables on the page dissappears.
    I’m adding this to the section called “Custom Commands:” – is this the right place?
    Do you have any other suggestions?

    Cheers,
    Jason.

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    One common problem here is the use of the correct quotation marks. Sometimes, copy/pasting can result in the wrong ones being used. Can you therefore please check if the quotation marks in the “Custom Command” are upright " ones, and not curly ones?

    Also for the date-eu date format, did you download, install, and activate the TablePress Extension from https://tablepress.org/extensions/datatables-sorting-plugins/ ?

    If all that does not help, 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 pczjrh

    (@pczjrh)

    Hi,
    Yep, it was the quotes.
    So difficult to see them, and I copied the code from this forum.
    Anyway, they are sorted now.
    Thank you very much for the quick reply and fix 🙂
    Cheers,
    Jason.

    Plugin Author Tobias Bäthge

    (@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 3 replies - 1 through 3 (of 3 total)

The topic ‘sorting dissapears on adding any code to custom fields’ is closed to new replies.