This is a migrated thread and some comments may be shown as answers.

Is return data of GridColumnMenuCheckboxFilter changed?

6 Answers 188 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Furkan
Top achievements
Rank 1
Veteran
Furkan asked on 04 May 2020, 02:38 PM

Hello,

I use GridColumnMenuCheckboxFilter to filter my grid.

But today I realize return data of GridColumnMenuCheckboxFilter is different than I used to before.

Before on dataStateChange function data property of event parameter was:

{
 "filter":{
  "filters":
    [
      {"field":"city","operator":"eq","value":"ANKARA"}
    ],
    "logic":"or"
  }
}

 

Now it is:

{
"filter":{
  "filters":
    [
     {
      "logic":"or",
      "filters":[{"field":"city","operator":"eq","value":"ANKARA"}]
     }
    ],
    "logic":"and"
  }
}

 

 

Is return data of GridColumnMenuCheckboxFilter changed?

6 Answers, 1 is accepted

Sort by
0
Furkan
Top achievements
Rank 1
Veteran
answered on 04 May 2020, 03:12 PM

and I can't give a color to active filter because th.k-header does not update to active.

I am using the code below to colorize active filter as you told before:

th.k-header.active > div > div {
 color:#f5222d;
}
0
Stefan
Telerik team
answered on 05 May 2020, 01:57 PM

Hello, Furkan,

Yes, the return type was changed (fixed) based on this issue:

https://github.com/telerik/kendo-react/issues/508

The reason is that the GridColumnMenuCheckboxFilter should produce composite filters, where initially it was producing flat filters with 'or'.

With the older version for example, if we filter on values 1 and 2 from column price and then value discounted from column promotion, we will still have values 1 and 2 even if one of them is not discounted because the filter expression was, 1 or 2 or discounted. The correct one is filter 1 - value 1 or 2 and filter 2 discounted.

-----------------------------------------------------------------------------------------------------------------------

As for the active state, this requires setting the headerClassName programmatically if the filter is part of the filter collection. I made an example showcasing this:

https://stackblitz.com/edit/react-jbuuvw?file=app%2Fmain.jsx (applied to the ProductID column)

We will consider making a helper method for this as well to improve usability.

Regards,
Stefan
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Furkan
Top achievements
Rank 1
Veteran
answered on 05 May 2020, 03:17 PM

But there is a problem. I add a searchColumn component to ProductName column. 

Apply these exactly:

1) Open ProductName filter and type a text like 'Chai'

2) Click the 'Search' button.

3) Now click the filter of Product Id column

It is going to crash. How do you fix that?

Here is the sample:

https://stackblitz.com/edit/react-yfm3jd?file=app%2Fmain.jsx

0
Stefan
Telerik team
answered on 06 May 2020, 01:58 PM

Hello, Furkan,

I agree that this is a critical issue and we pushed a fix now.

The fix is on a pull request and we will try to release a version in the dev channel with that fix by the end of the week.

Apologies for the inconvenience.

I also added some Telerik points to your account for letting us know about this issue.

Regards,
Stefan
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Furkan
Top achievements
Rank 1
Veteran
answered on 15 May 2020, 02:34 PM

Hi Stefan,

Did you publish the fix of this issue? How can I track it?

Thank you

0
Accepted
Stefan
Telerik team
answered on 18 May 2020, 01:35 PM

Hello, Furkan,

Yes, the fix is already published in version 3.14.0.

Usually, we make a GitHub issue, but in this case, we made the fix on the next day.

I updated the example and the version.

Also when I was updating the example I thought that the filterUI can be even cleaner approach, as it will render the default filter and clear button, add some styling and we will need to only render the input box:

https://stackblitz.com/edit/react-ndss73?file=app%2Fmain.jsx

Regards,
Stefan
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Furkan
Top achievements
Rank 1
Veteran
Answers by
Furkan
Top achievements
Rank 1
Veteran
Stefan
Telerik team
Share this question
or