Hi I'm trying to sort my table by a float column, for some reason the sorting is wrong, like it puts 7,121.37 above 68,582.76 (i guess because it start with a 7).
What query are you using to generate this table? Our PHP SQL parser has issues with queries with JOIN's, UNION's, CONCAT's and subqueries, so if you're including these (or any of these) functions, sorting, filtering and search may not work correctly.
If the query returns proper data, you can create a MySQL View in the database, and then create the wpDataTable with a simple query like SELECT * FROM view1.
Since your MySQL-query based wpDataTable doesn’t work correctly with server-side processing, you will need to prepare a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTable based on a simple query like “SELECT * FROM view1″.
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 statement automatically when users trigger the sorting on the front-end, and having it in initial statement may cause the table to crash.
So, in short, you will be able to use the server-side processing feature, but only if you create a view from your query. Now, since your query uses subqueries, I'm not sure you'll be able to create a view from it, so you may need to modify that query.
Hi I'm trying to sort my table by a float column, for some reason the sorting is wrong, like it puts 7,121.37 above 68,582.76 (i guess because it start with a 7).
see screenshot attached..
How can i fix this?
Seems like when I turn off the "enable server side processing" the issues is fixed.
but I do want server side processing \:
Hello Gal
Thank you for your purchase.
What query are you using to generate this table? Our PHP SQL parser has issues with queries with JOIN's, UNION's, CONCAT's and subqueries, so if you're including these (or any of these) functions, sorting, filtering and search may not work correctly.
If the query returns proper data, you can create a MySQL View in the database, and then create the wpDataTable with a simple query like SELECT * FROM view1.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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
Hi again Gal
Since your MySQL-query based wpDataTable doesn’t work correctly with server-side processing, you will need to prepare a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTable based on a simple query like “SELECT * FROM view1″.
Please note some this when working with the server-side processing feature:
So, in short, you will be able to use the server-side processing feature, but only if you create a view from your query. Now, since your query uses subqueries, I'm not sure you'll be able to create a view from it, so you may need to modify that query.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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