• Resolved shoolty

    (@shoolty)


    Firstly i must say u made great plugin ??
    But i have a little problem. As u can see on my picture something went wrong with sorting.
    https://wrzuc.se/i/5450f626ef290
    I bet it’s problem with ‘z?’, when script compares words in table he se firstly:
    in row number 1:number, number, LETTER (z)
    in other rows: number, number, DOT, number

    Is it possible to work it properly? Of course i can leave “zl’s” but its not a way out. Thanks for help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    thanks for your post, and sorry for the trouble.

    The reason for this basically is that you are sorting currencies and not numbers. And those letters indeed change the sorting algorithm (from numeric sorting to string sorting).

    To change this, you’ll have to install an extra sorting algorithm, using the TablePress Extension from https://tablepress.org/extensions/datatables-sorting-plugins/
    After installing that, please add a “Custom Command” like

    "aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 2, 3 ] } ]

    on the “Edit” screen of the table. The 2, 3 there indicates that this sorting algorithm shall be used in the third and fourth columns (counting starts with 0), so those numbers need to be adjusted.

    Regards,
    Tobias

    Thread Starter shoolty

    (@shoolty)

    It’s soooo alive!
    Thanks Tobias, great work:-))

    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 problem’ is closed to new replies.