Okay
  Public Ticket #2352499
Search functionality
Closed

Comments

  • Lina Le Bon started the conversation

    Hi, guys

    I am wondering if there is any way to have search functionality available on the fields that are configured as relationships.

    In my site drop down to Sourcing Data/Audits, Table id = 34. Ideally I would love to be able to search by typing any part of manufacturer name  either in the top search bar (which I disabled because it does not work) or at the bottom of manufacturer field. If I change filter type to text - search does not work. So all it seems I can do is to set it to select box. It is not ideal at all, it takes a lot of time to find the exact manufacturer out of the list of 1000+, especially given that inside the drop box you can only type in the first letter.  This feels very limiting. Is there any way to make text based search work?

    I have a lot of screens like that, and I always have to make excuses when doing demo on the site. I am afraid when it goes live, it will become a big annoyance factor, if it is not fixed.

    Kind regards, Lina

  •   Lina Le Bon replied privately
  •  2,572
    Aleksandar replied

    Hello Lina

    Issues with sorting, filtering and search may occur with queries with JOINS, CONCATs and other functions

    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.

    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

  • Lina Le Bon replied

    Hi, Aleksandr, my sql is

    SELECT *, concat('?page_id=338&audit_id=',ID) as 'Send Email'
    FROM qadb_audits

    Table id = 34

    I look at the logs after doing search and there isn't any errors. Normally if there is an SQL error - I'd see it there.

    Are you able to look at the configuration of the first field there, and tell me why search would not work?

    Thank you very much

    Lina

  •  2,572
    Aleksandar replied

    Hello again Lina

    You wouldn't see an SQL error, because there is none. 

    The issue here is that wpDataTables server has problems with parsing of the query, and that is why search, sorting and filtering don't work.

    The query is just fine, but having CONCAT, JOIN, UNION, and other types of similar statements can cause issues like this.

    Please try creating a view, and the issue should be solved.

    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