Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3382273
Sorting of data
Closed

Comments

  • Hugues Martin started the conversation

    Hello,
    I'm having a problem sorting the values in my filter. In the editor, you can see that the values are sorted as I would like (pic1). But when I display this in my site, the sorting is changed for the values in my selectbox (pic2). How can I change this and keep the sorting that was in the editor?

    Attached files:  pic1.png
      pic2.png

  •  1,692
    Miloš replied

    Hi, Hugues Martin.

    The only way to change the order of the selectbox would be to manually add these values in the column settings, under the "Data" tab.

    So, access column settings and go to the Data tab. In there, change the type to String (if you haven't already), and change the "Possible values for column" to be "Define values list". Then, below that add the values in the order in which you want them to appear:

    4911970747.png

    And that's the order they will appear in the filter:

    3163312299.png

    I hope this helps.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Hugues Martin replied

    Hello,

    Thank you for your reply, but this technique doesn't work for me because I take the filter values from a googlesheet which is changed every day, so there are new values for this filter. Is it normal that the order of the filter for integer data is also 1, 10, 11 and not 1, 2, 3?

  •  1,692
    Miloš replied


    Hi, Hugues.

    Our plugin is based on dataTables JQuery Plugin's libraries, which has certain limitations.

    When it comes to selectbox/multiselectbox filtering values,

    they will be sorted in the order of how you input new values in the table.

    -

    So, for example, if today you make a new source Google Sheet and you input 1, 10, 100 in that column,

     the selectbox filter of this column will offer them like that, without sorting.

    Then later on, if you add 2, 5, 7 ,   

    now the selectbox will offer :

    1,

    10,

    100,

    2,

    5,

    7

    and so on...

    So, unfortunately, for the selectbox/multiselectbox filter, it is not possible to set up any sorting,

    it will offer the values in the same order as they are input in the source data of the table.

    You can sort the Column in the Table, but for the filter, we currently do not have any workaround,

    other than going in and manually inputting the order of filtering values, as shown before.

    -

    Our developers will try to improve this and create a sorting method for the filters,

    but i can't say an ETA on that.

    If you wish to affect this development speed,

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Hugues Martin replied

    Hello,

    Thank you for your reply, but in my case the values are not in the same order as my source file. For example, my source file has a column so the values are sorted in ascending order. However, when I link this file to a wpdatables, the filter on this column appears as 1, 10, 11, 12 instead of 1, 2, 3, 4. Maybe there's something to change in the settings that I didn't do ?

  •  1,692
    Miloš replied

    Hi, Hugues.

    Can we take a look at your source Google Spreadsheet,

    if you can share access to the Sheet with my Email - [email protected] ?

    Then i can try to link it to my test table, and see if i can reproduce/see the issue in more detail,

    as you have shown on the screenshots.

    3604748746.png
    8643774170.png

    Is the source column in the Sheet called "Week", or did you edit the displayed Header name for the table, just to check?

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Hugues Martin replied

    Hello, Milos.
    I'll send you the spreadsheets in a few minutes. To answer your question, in my spreadsheet the column is called week, so I don't change the header title. Just to let you know that I have the same problem for all data types such as strings, integers and floats.
    Thank you for your time.


  •  1,692
    Miloš replied

    Hi, Hugues.

    Sorry for the waiting time.

    Thanks for sending the Google Sheet Access, i can see what you mean now.

    I tried multiple ways to get these numeric values from "Week" column to work as expected,

    but for some reason, they won't align properly in a selectbox use-case, 

    as integer or String.

    Basically, the column is behaving as a String when i set it as Numeric.

    For the String Data, in our plugin it is not possible to sort by numbers, so for Strings this is normal ( alphabetic sorting),

    but for numeric data ( integers/floats) it should order them correctly with Numeric sorting, 

    which it does in the table cells,  and even in the preview of the filter,

    in the column settings, if i click to "Predefined Values" it aligns them correctly, like

    1, 2, 3, 4, etc;

    4892180181.png

    but if i try to filter on the table itself, in the selectbox, it goes like  1, 10, 11, 12, 13

    and then when it is finished with 19,  the 2 comes up,  

    so this is alphabetical sorting which should be only for Strings - for Numeric Data it should not be like this.

    9579492239.png

    I will check if this is a bug, we will do more testing with our QA Team.

    Thank you for reporting this.

    As soon as we confirm if it is a bug or just a specific issue with your data set, we will report back right away.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Hugues Martin replied

    Hello,

    I'd understood that the thongs were alphabetical. But the problem is that even for the Integer type, the sorting also looks alphabetical. As you can see from the image, the type of the ID column is Integer and the sort to predefine the value is a numerical sort. However, when I use the filter with the table, the sorting is alphabetical. How is this possible?

    Attached files:  ID.png
      predefinedValues.png
      filterID.png

  •  1,692
    Miloš replied

    Hi, Hugues.

    We have confirmation on this.

    We isolated a bug for this behaviour.

    -

    This happens only for "non-server-side tables", such as tables linked to data source as Google Sheets.

    This issue is not present on our "server side processing" tables, which are Manual Tables and SQL Query based tables,

    because they use our own way to pull data for the selectbox from the database,

    while for non-server-side tables, the sorting for the Selectbox has this bug where it loads the alphabetical sorting.

    -

    Our developers isolated the bug, and they'll add it to their queue for fixing.

     They will do their best to build a fix as soon as possible.

     We don't have an ETA on when the fix will be available, but please keep a lookout on our wpDataTables changeLog.

    It will be stated there during updates which bug fixes have been implemented at each update.

    -

    For the time being, i can offer you two workaround ideas for this use-case :

    1. If you have to use Google Sheet as the data source / linked to the table,

    so that any editing on the source Sheet stays synchronized with the output wpDataTable,

    then until our devs fix this bug,

    you would have to change this Column type to "String",  then go in the Data Tab in Column settings,

    and change this "Possible values"  from "All" to any fixed number , such as "100".

    Then the table will correctly load the selectbox values sorted as 1, 2, 3, and so on :

    4174945294.png
    4209454386.png

    ( you can also check my Video, that shows that behaviour, download link here)

    If you don't have to use any numeric calculation functions on this Column,

    then you could use this method as a "temporary workaround" until we fix the bug.


    2. Or, if the column has to be integer ( or float) ,

     you can import data from the Google Sheet, to make a new Manual Table from it.

    In that case, our server-side processing would activate and this table would not have the bug for selectbox numeric sorting.

    Just important to note the difference in this method :


     If you import the file, the plugin reads the source file and creates a manual table

    Once the table is created, it is no longer linked to the source file, 

    so changing data in the table will not show up in Excel or Google Spreadsheet, and vice-versa. 

    To modify this table, you can either switch to the Excel-like view

    and then select and copy the range of cells you want to paste from the source file, and paste it in the Excel-like view, 

    or you can import a new/edited CSV to update the table, as well, in the following ways :

    I hope that helps. Sorry for this inconvenience.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables