Okay
  Public Ticket #2764384
Filtering and charts
Closed

Comments

  • Eli started the conversation

    Hey we have a few problems with the filtering in our tables.

    First the filtering options doesn't work for non Latin characters (non English letters) - our data base is in hebrew so we wanted to know if there is any chance we can use the filtering option with our database?

    The other thing  is when i try to make a new chart using a table that has a concat field or any other new field that i added i cant get the chart.


  • [deleted] replied

    Hi Eli

    Thank you for reaching out to us.

    The filtering option doesn't have anything to do with the language you are using so you shouldn't have any issues filtering in Hebrew, however the plugin is not yet RTL optimized.

    This is probably happening because wpDataTables server has problems with parsing of the query and building new queries dynamically (rarely happens, but does sometimes). To avoid this please prepare a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTabled 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.

    Everything shown on the table should be displayed on the chart as well, this should not be influenced by the functions used in the creation of the table, so if you could please send us a link to your chart or the SQL query used to construct the table so we can try to replicate the issue on our end?

  • Eli replied

    This is the query i used to make the table:

    select avg(w.zion_matzpen) as "ציון מצפ'ן" , concat(m.manager_name, " ",m.manager_last) as "ראש צוות" 

    from worker_table w, manager_table m 

    WHERE w.team_manger_id =m.manager_id

  • [deleted] replied

    Hi Eli

    Thank you for sharing that. As I presumed the issue is most likely caused by the query. 

    Any query that has JOIN, CONCAT, GROUP, UNION, etc. statements will cause issues with filtering, search and sorting.

    To avoid this please prepare a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTabled 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.

    Once you solve the issue in the table the chart should be displayed properly as well.