In Filter textbox, is there a way to specify to search a specific column of data?
In Filter textbox, is there a way to specify to search a specific column of data?
crunchfactory
Posts: 29Questions: 8Answers: 2
Hi, the title pretty much says it all, in the Filter textbox, in serverSide, is there a way to specify to only search a specific column of data? I saw how to add a search box to each column, that would be more than a little unwieldy, Thanks!
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Mind you I'm most familiar with the legacy code so you may have to do some translating if you're using the 1.10 style of code.
When you're using server side processing (at the server) you get the object oSettings and one of the fields it has in it is sSearch_(int), this is telling the server that you want to filter on that specific column. So if you wanted to only ever search based on that column as it sounds like you want than when you interpret the data on the server you could treat that column as though it was the global sSearch.
Hi, thanks for the response; so, in other words, no. That's ok, it was more for end-user creature comforts than a need to segregate data.
You could use the
column().search()
API to search on the column using your own input box. Or usecolumns.searchable
to indicate that the other columns should not be searchable.Allan
Hi Allan, thank you (again!) for the response; I was aware of those options, but feel it would be more than a little obtrusive in a 50+ column table! Simplicity seems the best route in this case (as in most); let the filter be a filter; once I'm past the "v1" functionality, I can start to think about replacing it with a full blown search mechanism, I was just exploring what functionality was included in the default filter.