• Resolved gabybbj

    (@gabybbj)


    Hi Tobias,
    Congratulations for your great Table plugin.
    I`m using your plugin for column filter, however I have a problem with the values at the filter box. wich is, even if in atributes they are Numeric, they doesn’t appear in real order, I mean they appears f.e. 116,12,136,156,17,… as you can see in filter S of the URL I sent.
    Is there any chance to ordered them as real numbers? (12,17,116, …)
    Thank you very much
    Best Regards

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

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I know what you mean, but unfortunately, I haven’t been able to find a solution to this. As I’m not the developer of the JavaScript code that’s behind this (I only packaged it as a TablePress Extension), I don’t know where the necessary changes need to be applied. Sorry 🙁

    Regards,
    Tobias

    Thread Starter gabybbj

    (@gabybbj)

    Thank you very much for your answer.
    Nevertheless do you know how can I find a solution for that or where and how can I looking for it?
    Or can you tell me from where can I get this Java code for analized?
    Thank you very much for your support.
    Best Regards

    Thread Starter gabybbj

    (@gabybbj)

    Hi Tobias,
    I found a possible solution but I don’t know how to implement it on your pluging.
    Can you help me with this?

    https://stackoverflow.com/questions/32497582/how-to-sort-drop-down-list-numerically-in-datatables

    Thank youvery much
    Best Regards

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    the relevant JavaScript file is part of the TablePress Extension, it’s the file tablepress-datatables-column-filter-widgets/js/ColumnFilterWidgets.js
    That’s where the change to sort the data would have to be made somehow.
    That solution from StackOverflow does not apply here, as that’s using a different approach from what I can see.

    Regards,
    Tobias

    Thread Starter gabybbj

    (@gabybbj)

    Thank you Tobias.
    I’m going to investigate by my side how can fix it.
    However, if you know in the future how to solve it, please let me know.
    Thank you very much

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    I hope you can find a solution! If I find something, I’ll definitely update the Extension!

    Best wishes,
    Tobias

    I have a very rough and ready fix for this! As you can see the info in the filters is being sorted alphabetically rather than as numbers. Rather than look at a fix which will then break other filters, you can rearrange the numbers so that they will show in the right order. You can do that by adding leading 0’s into the numbers. So if your biggest number is in the thousands for example a low number like 12 would need to be displayed as 0012. Obviously this isn’t the best, but it does work and the filter becomes usable.

    I should add too that if you have large tables like me that I import from Excel, Excel will do this work for you. Just highlight the cells you want to format (all the numbers), right mouse click them and select Format Cells. In the format cells dialogue box, hit custom and type 0# for two digit, 00# for 3 digits, 000# for 4 digits etc. In my case I was using this to filters sizes up into their thousands, so I used 000#. You can then save the file as an CSV and import and everything should then be in number order. I guess if you really wanted to go to town you could write a script that runs at the end that then deletes all these leading 0’s.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for sharing this suggestion!

    Best wishes,
    Tobias

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

The topic ‘TablePress Extension: DataTables ColumnFilterWidgets’ is closed to new replies.