Skip to content

Setting filteringExpressionsTree on grid not working. #5553

Closed
@eestein

Description

@eestein

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions