Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
Column formatter with excel filters not working properly
posted

Hi

I am using the formatter for several grid columns to apply formatting on numbers to required decimal places. The problem I am seeing is that if you have multiple values which format to same value they still show independently in the list. So for example if I format 0.0001 and 0.0002 to 2dp then they both become 0.00 but I would see 0.00 appear twice in the list. Each item then only selects it's underlying item

Is there a way to ensure that the excel style filter takes into account the formatter? In it's current state I can't see how using formatters is possible with filtering since the duplicate options referring to different entries make it impossible to use.

Is there any way to get it working so that if things format to same value that they appear once and select all related values?

Thanks

Parents
  • 20255
    Offline posted

    Hello Katy Faulkner,

    Thank you for contacting us! Based on the requirement, I see two options:

    Option 1: Format the data before passing it to the Grid.

    Option 2: Use a unique value strategy - the list items (values) can be provided manually and loaded on demand. This is mostly relevant to the Remote data operations, although in your case it would be handful as well. This uniqueColumnValuesStrategy input is accepting column, filteringExpressionTree and done callback that would be called with the newly added column values when they are passed. 

    Following the above will populate the list with the desired values BUT that wouldn't be enough. If you select the "0.00" item from the list, nothing will be filtered, as the relying data items would still be 0.0001 and 0.0002. This is why another custom implementation is needed, this time for the Filtering operands - you should create custom filtering operands for conditions like Equals, Not Eq, Greater than and etc. - example.

    Grid's Filtering feature is very powerful and rich, and you can achieve almost everything with it, although there are cases when these type of changes are more suitable for the data change implementation, before passing it to the Gird, this is why my recommendation is to follow Option 1.

Reply Children