Skip to content

Setting filteringExpressionsTree on grid not working. #5553

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

Closed
eestein opened this issue Jul 31, 2019 · 5 comments
Closed

Setting filteringExpressionsTree on grid not working. #5553

eestein opened this issue Jul 31, 2019 · 5 comments
Assignees
Labels
🐛 bug Any issue that describes a bug filtering 🆕 status: new

Comments

@eestein
Copy link

eestein commented Jul 31, 2019

Description

I can't get the filter to be loaded on the grid's initial state. I'm saving the grid's state locally, like hidden columns, filters used and column width. But I can't restore the filters. It just won't work. This is my code:

console.log('grid config', config);
console.log('this.grid.filteringExpressionsTree', this.grid.filteringExpressionsTree);
this.grid.filteringExpressionsTree = config.filters;
console.log('this.grid.filteringExpressionsTree', this.grid.filteringExpressionsTree);

config is always set and correctly so. But even after adding filters, which is an IFilteringExpressionsTree the property won't reflect that change. What is happening here? Is this a bug or am I missing something?

I checked the source code and noticed a instanceof FilteringExpressionsTree check and tried to implement it locally to see its result and I got a false result, even by forcing it like this:

const tst: FilteringExpressionsTree = config.filters as FilteringExpressionsTree;
console.log('this.grid.filteringExpressionsTree', tst);
this.grid.filteringExpressionsTree = tst;
console.log('is FilteringExpressionsTree', tst instanceof FilteringExpressionsTree);

This is weird, because the logging of tst shows it has the proper values set, so it wasn't a cast issue. It's all looking a little bit weird to me.

Also, since I've opened this ticket. Is there a way to retrieve and set the columns' width?

  • igniteui-angular version: 8.0.1
  • browser: Firefox

Steps to reproduce

Explained above

Result

Nothing.

Expected result

The grid would display and react upon the set filters.

Attachments

N/A

@eestein eestein added the 🐛 bug Any issue that describes a bug label Jul 31, 2019
@eestein
Copy link
Author

eestein commented Aug 2, 2019

Any comments on this? It's been two days already and this is blocking me. I'd appreciate any help.

@zdrawku
Copy link
Contributor

zdrawku commented Aug 5, 2019

Hello @eestein, this is something that we'll definitely look at.

@DiyanDimitrov
Copy link
Contributor

@eestein, This topic demonstrates how to implement persistence of the IgxGrid component. If you still have issues loading the filtering expressions, could you provide a sample where the issue is reproducible?

@eestein
Copy link
Author

eestein commented Aug 5, 2019

Ok, using that example I was able to figure out the problem. I can't persist and just restore filteringExpressionsTree, I need to recreate the object. That was the problem. This behavior is a little bit weird to me, though.

@eestein eestein closed this as completed Aug 5, 2019
@zdrawku
Copy link
Contributor

zdrawku commented Aug 5, 2019

Thank you for your comments @eestein, we plan to create a state persistence directive that will ease the persistence of filteringExpressionsTree #5460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Any issue that describes a bug filtering 🆕 status: new
Projects
None yet
Development

No branches or pull requests

3 participants