Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Tree grid Rows expanded when the filter is active

Tree grid Rows expanded when the filter is active

New Discussion
Manikanta Vundavalli
Manikanta Vundavalli asked on Apr 26, 2022 8:58 AM

Hi,

I have a scenario where after the grid rows are filtered by a column and then when grid refreshes the filter state is intact but the rows are expanded after view is loaded.

Is there a way to collapse the rows every time after the view is rendered? 

Thanks,

Manikanta Vundavalli

Sign In to post a reply

Replies

  • 0
    Tihomir Tonev
    Tihomir Tonev answered on Apr 20, 2022 12:06 PM

    Hello,

    You can use grid's collapseAll method in order to collapse all rows. Putting it in ngAfterViewInit will have it called on each reload.

    Are the rows being expanded on purpose? If you believe this is not the intended behavior of the grid, please provide steps to reproduce this behavior so we can test on our side what might be causing it.

    Sincerely,

    Tihomir Tonev
    Software Developer
    Infragistics

    • 0
      Manikanta Vundavalli
      Manikanta Vundavalli answered on Apr 21, 2022 8:06 PM

      Hello,

      In the below Sample where we are using custom filtering by default all the rows are expanded. If I collapse all the rows and filter the first column for two rows and after filtering done the rows are all collapsed.

      In my scenario after filtering the rows should be collapsed. 

      When I debug through the igniteui-angular script file I found that in the IgxTreeGridFilteringPipe class has expandAllRecursive function where we're actually setting expandedStates.set(rec.rowID, true); the row expand state to be true. Is there any way to override it from the code?

      filteringSample

      Thanks,

      Manikanta Vundavalli

      • 0
        Tihomir Tonev
        Tihomir Tonev answered on Apr 26, 2022 8:58 AM

        Hello,

        The method mentioned is private, so at this point it cannot be accessed on application level.

        I have tested the provided sample and the tree is expanding only the records with filtering match, which is the intended behavior so I could not find anything out of the normal.

        If I am missing something, please let me know.

        Sincerely,

        Tihomir Tonev
        Software Developer
        Infragistics

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Manikanta Vundavalli
Favorites
0
Replies
3
Created On
Apr 26, 2022
Last Post
3 years, 10 months ago

Suggested Discussions

Created on

Apr 26, 2022 8:58 AM

Last activity on

Apr 26, 2022 8:58 AM