Okay
  Public Ticket #1659450
Filter/search not working with server side processing
Closed

Comments

  •  1
    Jonathan started the conversation

    I've had an SQL query written that returns the results to the table perfectly. However, if server side processing is tuned ON the search and filtering functions do not work.

    If server side processing is off, they work OK. 

    The above link is to a table with serverside turned on.

  •   Jonathan replied privately
  •  471
    Isidora replied

    Hi Jonathan,
    Thank you for your purchase.

    If your MySQL-query based wpDataTable doesn’t work correctly with server-side processing, probably this is happening because wpDataTables server has problems with parsing of the query and building new queries dynamically (happens rarely, 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 triggers the sorting on the front-end, and having it in initial statement may cause the table to crash.


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •   Jonathan replied privately
  •   Jonathan replied privately
  •  471
    Isidora replied

    Hi Jonathan,

    Yes you are getting this error  because you can't create view in our MySQL query box. You need to make view in your database with tool that you use(e.g. phpmyadmin)

    Like I explain you in previous post If your MySQL-query based wpDataTable doesn’t work correctly with server-side processing, probably this is happening because wpDataTables server has problems with parsing of the query and building new queries dynamically.

    You said that your query is returning data that you need in our plugin, so it will return also that data in your phpmyadmin or other tool that you use. From that query you need to make a view and then you in our plugin

    “SELECT * FROM view_name″


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Jonathan replied

    One last question. The view would be getting it's data from custom posts. Would the view automatically update when a new post is added? 

  •  471
    Isidora replied

    Hi Jonathan,

    Yes, it will be updated and you will see changes after loading the page. When you SELECT from a view, the database has to run the query stored in the view to get the result set to use in your statement.The data you 'see' in a view, is not actually stored anywhere, and is generated from the tables on the fly. 

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Jonathan replied

    Thanks. I now have this working OK. Once I understood the 'view' function it went well. Maybe you could make a help video which actually shows how to make a view in phpMyAdmin and then link it to the query in wpDataTables. I bet that would be really handy for people. 

    I'me very happy with the way it is working now. 

    ps One problem I did have was that there were special characters in the headers like ? and also some numbers. These caused sql errors. Now the headers are just text it works fine. 

  •  471
    Isidora replied

    Hi Jonathan,

    You are welcome. 

    Thank you for your suggestion. I will provide that to my team to make such thing for users that are not familiar with creating views in mysql.

    Best regards

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables