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

Introduce an input to set FilteringStrategy per column in IgxGrid #5323

Closed
hanastasov opened this issue Jul 5, 2019 · 8 comments · Fixed by #5747
Closed

Introduce an input to set FilteringStrategy per column in IgxGrid #5323

hanastasov opened this issue Jul 5, 2019 · 8 comments · Fixed by #5747
Assignees
Labels
Epic filtering grid: general 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@hanastasov
Copy link
Contributor

hanastasov commented Jul 5, 2019

Is your feature request related to a problem? Please describe.

Currently an approach to provide custom logic for filtering per column means to make a custom filter operands that requires ALL filtering conditions to be implemented by the developer. Another approach would be to filter the underlying datasource and pass a filtered data collection as data source to the grid. Both approaches are not effective and it would be best if the developer can provide a custom filteringStrategy per column.

Describe the solution you'd like

Being able to pass a filtering strategy for a column:

<igx-column filteringStrategy="customFilteringStrategyInstance">
</igx-column>

Describe alternatives you've considered

Currently an approach to provide custom logic for filtering per column means to make a custom filter operands that requires ALL filtering conditions to be implemented by the developer., which makes the approach ineffective.

Another approach would be to filter the underlying datasource and pass a filtered data collection as data source to the grid.

@kdinev
Copy link
Member

kdinev commented Jul 29, 2019

Related #5448

@kdinev
Copy link
Member

kdinev commented Jul 29, 2019

@hanastasov Is there a scenario that cannot be satisfied with a CustomFilteringOperand? The idea behind the operands is to provide custom per-column strategies.

@kdinev kdinev assigned DiyanDimitrov and unassigned zdrawku and rkaraivanov Jul 29, 2019
@hanastasov
Copy link
Contributor Author

@hanastasov Is there a scenario that cannot be satisfied with a CustomFilteringOperand? The idea behind the operands is to provide custom per-column strategies.

I don't find a scenario that could not be satisfied with a CustomFilteringOperand. What I find not the best experience is that the dev needs to write the filtering logic for all conditions, even if the dev only wants to do filtering via a nested value, for example.

@kdinev
Copy link
Member

kdinev commented Jul 29, 2019

To filter by complex object would require to override all operand, but with a filtering strategy, the operations would still execute through the operand, which means that all of them would still require to be overridden.

@hanastasov
Copy link
Contributor Author

hanastasov commented Jul 30, 2019

To filter by complex object would require to override all operand, but with a filtering strategy, the operations would still execute through the operand, which means that all of them would still require to be overridden.

Wouldn't one be able to unwrap the value from the complex object on filtering strategy level ? In such case, one would not need to override the operands as well:

export class CustomFilteringStrategy extends FilteringStrategy  {
    protected getFieldValue(rec: object, fieldName: string): any {
        return rec[fieldName]["fieldToGetValueFrom"]
    }
}

@kdinev
Copy link
Member

kdinev commented Jul 30, 2019

@hanastasov I guess that is right, but this can still be handled in the top-level filtering strategy provided to the grid, can't it?

@hanastasov
Copy link
Contributor Author

hanastasov commented Jul 30, 2019

@kdinev There is no exposed way for a dev to provide a filtering strategy for the grid, but even if there is, it will work on grid level, not per column.

@kdinev
Copy link
Member

kdinev commented Jul 30, 2019

@hanastasov OK, if the grid-level strategy is not exposed, then we should expose it.

@radomirchev radomirchev added this to the Milestone 9 milestone Aug 26, 2019
@Aleksandyr Aleksandyr added 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels Sep 2, 2019
@Aleksandyr Aleksandyr assigned Aleksandyr and hanastasov and unassigned hanastasov Sep 3, 2019
@Aleksandyr Aleksandyr removed the 🛠️ status: in-development Issues and PRs with active development on them label Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic filtering grid: general 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants