Multi column search?

Multi column search?

stenbergstenberg Posts: 10Questions: 2Answers: 0

Apologies if this has been answered, but I have not been able to find how to perform a multi column search in datatables editor instead of the default layout which provides a single all-column search? TIA.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,389Questions: 26Answers: 4,784

    Not sure exactly what you are looking for but you can use columns().search() to search multiple columns. There are a few examples in the doc page.

    Kevin

  • allanallan Posts: 61,893Questions: 1Answers: 10,144 Site admin
    Answer ✓

    The built in search() method can be used to search on all columns that are marked as searchable (columns.searchable). The columns().search() method that Kevin mentioned is a shortcut to column().search() - i.e. it apples the given search term to all columns in the selector. It does not create a sub-group for a search. That is something I am considering adding in future.

    If you want to search across multiple columns in an OR fashion not using search() then you would need to create a search plug-in.

    Allan

  • stenbergstenberg Posts: 10Questions: 2Answers: 0

    The search that Kevin refers to I think I saw. The search plug in looks great for small tables because its done in the browser. In most cases mine are large and so we need to do it on the server. Basically what I need is an advanced search that will let a user enter different values in specific columns perhaps also with AND/OR. I think I will need to build in a front end page that presents those choices and then refresh the data - server side - which I have done in some other editor projects.

    Allan perhaps in a future version you would consider an "Advanced Search" capability where the user can select values in multiple columns and expressions like "starts with" , "=", etc. Those values would have to hit the server to refresh the dataset as some of my tables have millions of rows.

    Thanks!

  • allanallan Posts: 61,893Questions: 1Answers: 10,144 Site admin

    Its funny you say that... That is exactly what I am planning. I had been thinking of it primarily for client-side, but you make a good point that I should also consider how it can transmit data to the server for server-side processing the complex data cases.

    Allan

  • stenbergstenberg Posts: 10Questions: 2Answers: 0

    We would be greatly thrilled if you do! We are replacing some other CRUD products that didn't meet our long term needs, but did have that feature. If you built in the complex search as an option it doesn't seem like much of a stretch to be able to transmit that securely back to the server and then refresh the dataset. We are probably going to build in this capability in the interim for our specific needs, but it would be great to have that "off the shelf" for future projects.

This discussion has been closed.