Change render while filtering?
Change render while filtering?
Hi, it appears to me that "render" and "filter" are totally separate from one another, but I was wondering if there was a clever way to render a cell differently when using a filter. I have a column which is filtered on another column where each row contains a list of names to match, I'd like to render whichever name in that list is matched when filtering. As it currently stands it seems that the render option cannot use any information from the current filter, but I'd be happy to be wrong!
This question has an accepted answers - jump to answer
Answers
You mean when a filter is applied to the table you want to display different data in a cell? There is no option to do that I'm afraid.
Allan
@allan Yep that's right. OK, good to know. Hopefully something that could be done further down the line.
To be honest, I doubt it - this is the first time I recall such a request. I would also be concerned about the performance impact. Its not something I'm currently considering for inclusion in DataTables.
Having said that, you could make use of the
search
event to detect when a search is made and then adjust the data accordingly. You would need to make sure you use orthogonal data so that the search match doesn't change after you update the data!Allan