SearchPane - column selection
SearchPane - column selection
Freedy
Posts: 33Questions: 5Answers: 0
Hi,
I have a quick question, when using the SearchPane how would I use just the 2nd and 3rd columns for
filtering?
Thanks,
Thomas
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Depending on what you want you can start with one of these two examples:
https://datatables.net/examples/api/multi_filter.html
https://datatables.net/examples/api/regex.html
Kevin
It's explained in the SearchPane documentation. Use the "columns" option: " The columns that should have search panes shown."
Yup - options are documented in the blog post include the
columns
option @tangerine mentioned.Allan
Hi,
Would the syntax be something like this?
Thanks,
Thomas
No it would be:
This assumes you've set the column names using
columns.name
.See the
column-selector
documentation for details of what you can use as column selectors.Allan
Thank you,
I was missing the
columns.name Option
. Will there be support forserverSide
in the future?
Thanks,
Thomas
Possibly. At the moment the data to show is determined by the data in the table. With server-side processing, the server would need to pass a list of options to the client-side. That is certainly something that can be looked into.
I've added it to the list here.
Allan
this column selection didn't for me
You don't have any columns that match those selectors though. The
:name
selector specifically matches against thecolumns.name
option, not the text in the header cell.You'd need to use the jQuery
:contains
select - e.g.:contains('Position')
.Allan
@allan,
Thanks for your reply. But I'm still stuck understanding your statemen:
use the jQuery :contains select - e.g. :contains('Position')
can you give me in live demo
Thank in Adv
should do it.
Allan
@allan,
It works perfectly.
Thank you