We're Moving to a New Support Platform – Starting June 1st!

We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.

You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.

While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.

We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.

Thanks for your continued support and trust – we’re excited to bring you an even better support experience!

Okay
  Public Ticket #2680999
sorting results not consistent
Closed

Comments

  • fangquans started the conversation

    Dear Support,

    The same code produce different results from phpmyadmin vs wpdatatable.

    My intention is to put the NULL values at the end, after sort ascending. I appears the results from phpadmin are correct. In wpdatatable, the NULL vaules are still at the beginning of the table. 

    Please take a look at the screenshots. 

    /* civil */ 
    select `2021Ranking` AS `2021排名`, 
    table1.cname AS `大学中文名`, 
    table1.name AS `大学英文名`, 
    table2.major_ranking AS `专业排名` 
    from table1, table2 
    where table1.University_ID = table2.University_ID 
    order by ISNULL(`2021Ranking`), `2021Ranking` asc;
    
  •  2,576
    Aleksandar replied

    Hello fangquans

    Please note some this when working with the server-side processing feature:

    • Please do not use “LIMIT” in the SELECT statement. wpDataTables adds it automatically and it will be overridden.
    • Please do not use “ORDER BY” in the SELECT statement. wpDataTables has its own sorting engine, so it makes no sense to use MySQL’s sorting, since it will be overridden. Also, server-side processing feature adds this part of the statement automatically when users trigger the sorting on the front-end, and having it in the initial statement may cause the table to crash.

    So, when you create the table you can access column settings, and under Sorting tab make sure this column is used for sorting by default, and then set up so it's either Ascending or descending.

    Kind Regards, 

    Aleksandar Vuković
    [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

  • fangquans replied

    HI Aleksandar,

    "So, when you create the table you can access column settings, and under Sorting tab make sure this column is used for sorting by default, and then set up so it's either Ascending or descending."

    No Problem, I could do that. 

    But how do you put NULL values at the last, when other values of this column is numbers? 

    I played with SELECT statements for a reason, the Sorting tab can't cover everything. 


  •  2,576
    Aleksandar replied

    Hello again.

    NULL values are not valid entries for numerical columns, so the plugin can have issues with sorting of these values. Numerical columns need to have a number in them by default.

    You can try adding the SQL query you initially used to create a MySQL view. Then, if you pull that view from the database, it may use the ORDER BY function, but I can't promise that.

    Kind Regards, 

    Aleksandar Vuković
    [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