Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying a column filter to the IgrDataGrid with multiple conditions results in a blank grid #53

Open
agoldenbaum opened this issue Feb 7, 2024 · 1 comment
Assignees
Labels
🐛 bug Something isn't working

Comments

@agoldenbaum
Copy link

Steps to Reproduce

  1. Run the attached sample project.
  2. Click the button to apply the filter to the grid

Result
The filter is applied to the grid in the same way as if it was applied in the UI, but the grid is blank after the button click.

Notes
After applying the filter, if you open the Excel menu of the "ID" column, the correct values are checked. If you click the "Apply" button in the column options, the filter is applied correctly.

binding-local-data.zip

@agoldenbaum agoldenbaum added the 🐛 bug Something isn't working label Feb 7, 2024
@ig-robstoffers
Copy link

@agoldenbaum The reason for this is because the ColumnFilterConditionGroup defaults to AND so the filter in the sample is looking for individual records that have ProductID equal to 1001, 1002 and 1003 which is not possible. The group needs to use an OR filter. Unfortunately all the properties on these filter types are obfuscated so it's not apparent how to do this.

If you adjust the filter code like below it should work:

        let group: ColumnFilterConditionGroup = new ColumnFilterConditionGroup();
        group.g = true; // use OR filter
        let groupCollection = (group as any).f as ColumnFilterConditionCollection;
    
        let filterCondition1: ColumnComparisonFilterCondition = new ColumnComparisonFilterCondition();
        filterCondition1.f = ColumnComparisonConditionOperatorType.Equals;
        filterCondition1.l = 1001;
        ...

I'm leaving the issue open because we need to resolve the obfuscation issue.

@ig-robstoffers ig-robstoffers self-assigned this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants