Change render while filtering?

Change render while filtering?

guillochonguillochon Posts: 56Questions: 19Answers: 0

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

  • allanallan Posts: 61,985Questions: 1Answers: 10,162 Site admin
    Answer ✓

    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

  • guillochonguillochon Posts: 56Questions: 19Answers: 0

    @allan Yep that's right. OK, good to know. Hopefully something that could be done further down the line.

  • allanallan Posts: 61,985Questions: 1Answers: 10,162 Site admin
    edited January 2018

    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

This discussion has been closed.