Prevent flexgridfilter values from disappearing from menu during filtering

Posted by: matt_baker on 24 February 2021, 10:51 pm EST

  • Posted 24 February 2021, 10:51 pm EST

    Can the flexgrid filters be configured to grey out, but still make selectable, values that exist in the source collection but filtered out in the collection itself?

    Example: Assume we have two columns: Country and Month. Normally, if you choose a value for Country, and Months not appearing for a country would be removed from the value list. I want to be able to see and choose any distinct value from either column.

    Is this possible with FlexGridFilter, or do I need to design a custom solution that filters the collection directly?

  • Posted 25 February 2021, 12:07 am EST

    I’ve figured out how to use ```

    filterChanging.addHandler()

    
    [b]Steps:[/b]
    * Open filter for Column A. Choose one value. The filtered grid view should update.
    * Open filter for Column B.
    	- Expected: My custom unique values for Column B should appear
    	- Actual: The filtered, unique values based Column A appear (this is the default Wijmo behavior, but not wanted in this case)
    * Close filter for Column B and reopen filter for Column B.
    	- Actual: My custom unique values for Column B appear
    
    
    I am adding the handler in ```
    onFilterInit()
    ```, which is called using Vue's initialized property:
    
    

  • Posted 25 February 2021, 5:12 am EST

    Hi Matt,

    Instead of assigning the uniqueValues in filterChanging event, you may assign the uniqueValues right after grid is initialized. And then to grey out filtered values you may handle the filterChanging event and figure out which values are filtered out and add class to style then accordingly. Please refer to the following sample which demonstrates the same and let me know if you face any issues:

    https://codesandbox.io/s/wijmo-vue-forked-o6vnr?file=/src/components/HelloWorld.vue

    Regards

    Sharad

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels