You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having issues using the valueFilter option to have predefined filters. Currently, in my data I have an attribute called "Colors". I wish to filter color via the valueFilter option for Green.
I have a variable like:
which is stored in the component's state and gets assigned to the pivot table's valueFilter option. This method works for filtering for green by filtering out the other colors. However, if I change the variable to look like:
var valueFilter = {"Colors":{"Green": true}};
It filters out green and displays all of the other colors. How can I use the valueFilter option without assigning each other color to false (I wish to do this because I want to make the color filter dynamic and passed in via props)?
I think this may be an implementation issue. From what I can tell the intent was for
var valueFilter = {"Colors":{"Green": true}};
to do what gmacias711 expected. Looks like Nicolas merged inclusions and exclusions parameters from pivotable.js (see https://github.com/nicolaskruchten/pivottable/wiki/Parameters about Pivotable.js's inclusions and exclusions parameters ) into one valueFilter but it is not handling the inclusions side correctly. It can be cumbersome to have to collect all the exclusions instead of what should be included -- especially if valueFilter is a prop that currently can not be modified! This is biting me.
Activity
JonasWangLilly commentedon Mar 14, 2019
Did you manage to find the answer to your question? If so do you mind sharing?
gmacias711 commentedon Mar 18, 2019
What I ended up doing was create a function that sets up the value filter and sets all colors to false, omitting the dynamic color.
aboulang commentedon Jul 9, 2022
I think this may be an implementation issue. From what I can tell the intent was for
var valueFilter = {"Colors":{"Green": true}};
to do what gmacias711 expected. Looks like Nicolas merged inclusions and exclusions parameters from pivotable.js (see https://github.com/nicolaskruchten/pivottable/wiki/Parameters about Pivotable.js's inclusions and exclusions parameters ) into one valueFilter but it is not handling the inclusions side correctly. It can be cumbersome to have to collect all the exclusions instead of what should be included -- especially if valueFilter is a prop that currently can not be modified! This is biting me.