searchBuilder and search

searchBuilder and search

straetchstraetch Posts: 8Questions: 5Answers: 0

When I use an Equals condition in searchBuilder it used to work.
Then I introduced
search: { return: true}
to improve performance for my table with 14,000 entries, so a simple search is activated on ENTER.
Now the searchBuilder does not filter the data on an Equals condition any more. Hitting ENTER does not help.
Second problem: Because the search on Equals in searchBuilder does not work, I tried to remove the Equals condition from searchBuilder. With such a big table, the combobox becomes too long anyway. An Equals condition with a plain text box seems not available in DataTables.
However, following https://datatables.net/extensions/searchbuilder/customConditions#Removing-a-condition on condition '=' has no effect. Moreover the statement
delete $.fn.dataTable.SearchBuilder.conditions.num['='];
crashes datatables.
Using DataTables 2.2.2 and searchBuider 1.8.2 .

Answers

  • kthorngrenkthorngren Posts: 21,934Questions: 26Answers: 5,067
    edited May 4

    Interesting problem. I built a simple test case to show the issue:
    https://live.datatables.net/zulogebo/1/edit

    @allan will need to take a look.

    As a workaround, until there is a potential fix, you could remove the default search input using layout and add your own to replace it using the technique shown in this example. Create your own change event handler for the input to use search() o perform the search.

    Kevin

  • straetchstraetch Posts: 8Questions: 5Answers: 0

    In my opinion the integration of searchBuilder with Search has many advantages.
    search: { return: true}
    Is not only active in Search, but also in searchBuilder, preventing the filtering after each character typed in the value field of a searchBuilder filter rule (other than Equals). Exactly what I need to improve performance. So, replacing the standard Search with a custom solution, is not really an option.
    I noticed that an Equals rule does become active when adding a blank new filter rule. I will instruct my users to do that as a temporary measure until a better solution is available.

  • allanallan Posts: 64,338Questions: 1Answers: 10,623 Site admin

    Thank you for letting me know about this, and Kevin for the test case. I'll try to make to some time to dig into this in the next few weeks.

    Allan

Sign In or Register to comment.