Add Multi Column Search to jQuery ServerSide Datatable Using Single Search Field
Add Multi Column Search to jQuery ServerSide Datatable Using Single Search Field
Just wanted to confirm if there are examples of the following functionality:
I have three columns in a jQuery datatable: Name, Department, and Role.
I have a single search field.
I need the search to work as follows:
If a user enters "bob IT technician" or any combination of these values regardless of position, it returns records that have all of the values. This would be different from global search, which returns records that have any of the values.
For example, a user could search for "bob" only or "IT" only or "technician" only.
Or a user could search for "bob IT" or "Technician bob", etc.
I know that I can add this functionality by using 3 search fields (Name, Department, and Role) instead of 1.
I just want to confirm if there are examples of this functionality with datatables, since this functionality was previously created using a stored procedure for filtering, pagination, and sorting. I am not certain what was used to display the table and records in the view, but it was not datatables.
I am not using the same stored procedure because I am using EF.Reverse.POCO and I have been unable to generate the result model, since there is an issue with POCO and records returned via temp tables.
I am using DataTables 1.10.20, ASP.NET MVC, and Framework 4.8.
Answers
I'm afraid I'm not understanding how this is different from the global search that DataTables offers.
Consider this example - if you search for
Tokyo Airi
it will match the first row in the table.Can you give me an illustration of what you want based on that table?
Allan
You are correct that it is like global search. I was thinking that it worked a different way. Can global search be applied to a server side datatable that uses C#?