question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

filterService's updateFilters doesn't work with tree data

See original GitHub issue

I’m submitting a Bug report

Your Environment

Software Version(s)
Angular 8.1.1
Angular-Slickgrid 2.20.1
TypeScript 3.5.3

Describe the Bug

Hello, I have a custom HTML form that uses filterService.updateFilters on columns with Filters.multipleSelect, but since I set enableTreeData: true in the grid configuration, it doesn’t work anymore - oddly it works fine using the header row built-in filter.

Steps to Reproduce

As described above, manually update the filters using the FilterService with a multipleSelect kind of filter, works just fine until I enabled TreeData in the grid configuration.

Expected Behavior

filterService.updateFilters should work as the header row built-in filter does.

Current Behavior

The updated filters doesn’t seem to apply on the grid data.

Possible Solution

I’ve noticed that the DOM filter relies on callbackSearchEvent. Forcing triggerOnSearchChangeEvent on updateFilters (e.g. updateFilters(filters, true, true, true)) so that it calls callbackSearchEvent too fixes the issue.

So it might have to do with the way Slickgrid is notified from the filter change? updateFilters uses this.emitFilterChanged(emitterType); while triggerOnSearchChangeEvent directly uses this._onSearchChange.notify.

Thanks a lot!

Code Sample

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
ghiscodingcommented, May 21, 2021

It took me longer than I expected but the new version is now out and there’s a few other features as well, so go check it out. Take a look at the new version 2.29.x

Cheers ⭐

1reaction
ghiscodingcommented, May 11, 2021

Btw is there plans to have an insertItem(before, item) method in the Grid service, similar to the one in dataView?

no plans, the addItem has a position option for top/bottom but that’s all and that is always enough for me. You have 2 ways to deal with this

  1. use the DataView directly
    • the Grid Service is more of a helper, I created it to avoid having to write the same few lines of code over and over but you can still go with the DataView directly
  2. contribute to the project and maybe add a positionIndex that could be an extra option to the addItem
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular-Slickgrid/grid-tree-data-hierarchical.component.ts at ...
* A simple method to add a new item inside the first group that we find. * After adding the item, it will...
Read more >
Filter doesn't work expected when apply on tree data grid in ...
I want all of the child records of filtered parent record to get displayed when I expand the parent record irrespective of searched...
Read more >
Reusable Custom Filter Components - Kendo UI for Angular
Create a custom component that will take the filter of the current column and the FilterService as inputs. The data to which the...
Read more >
Tree Data - AG Grid
The property groupSelectsChildren does not work with tree data. This is because groups in tree data are rows passed by the application that...
Read more >
Decomposition tree filter - Microsoft Power BI Community
Solved: Hi, I am working with "Decomposition Tree". ... yes, it seems like filtering to other visual doesn work if you choose not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found