Why "searchable: false" erase the data of the column?
Why "searchable: false" erase the data of the column?
markzzz
Posts: 49Questions: 8Answers: 1
Hi there,
I've this column settings:
columns: [
...
{ data: "ClinicID", title: "", visible: false, searchable: true },
...
]
I hidden the field, and I want to keep the value within it (because I use as pivot for other searches; i.e. its related to other data).
But:
- if I set
searchable: true
and I insert the ID, it filters also for that column on a Search input field (for example). - if I set
searchable: false
, it empty the value, so I can't use it as pivot anymore.
What should I do?
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Setting the column's searchable flag to
false
certainly shouldn't make the content invisible. Can you link to a page showing the issue please?Allan
I mean: setting searchable flag to
false
will prevent to be searched by Search input field.But later, if I do somethings like this:
The field
data[columnID]
data is always 0 for the columnID withsearchable: false
, that's what I mean. I need to setsearchable: true
(so it keep its value), but at that point it returns searcheable by Search input fieldAh - I see what you mean. The search plug-ins actually get passed more parameters, including the original data object for the column (4th parameter) which you could get the data from.
Allan
I see. That's perfect.
Unfortunately,
searchData
is "an array" (so I can access with [], and index).rowData
is an object, and I can't access to it using index/columnidIs there any workaround?
Thanks
The
rowData
is the original data object for what you use to populate the row. If that is an object, then yes, it would be an object. You could use$.map
to convert it to be an array if you need.Allan