Page 1 of 1

[REACT] Column filter after using column renderer

Posted: Mon Jan 30, 2023 11:43 am
by vconstruct

I have used renderer to return true/false values as yes/no.
It worked fine but when I am trying to filter the column using Yes/No it is not showing any data. Filter is still working with true/false only.

How can I achieve that? How can I filter with rendered values?
I have used renderer to one of the column

renderer({ value }) {
        return value === true ? 'Yes' : 'No';
      },
 

Re: [REACT] Column filter after using column renderer

Posted: Mon Jan 30, 2023 12:08 pm
by tasnim

Hello,

It worked fine but when I am trying to filter the column using Yes/No it is not showing any data. Filter is still working with true/false only.

Filter always applies the filter in the store. And the store has the data that you've set, and it has true and false values (value : true) But it doesn't have the values as Yes or No (value : 'Yes'). So that's why you're only able to filter with true and false

https://bryntum.com/products/grid/docs/api/Core/data/Store#function-filter

How can I achieve that? How can I filter with rendered values?

You cannot filter the rendered values. If you want to filter by Yes or No then you need to set the data value : 'Yes' or value : 'No'