Maintain Filter Menu state when reopening

3 Answers 19 Views
Grid
Iuliana Maria
Top achievements
Rank 1
Iron
Iuliana Maria asked on 24 Sep 2021, 11:03 AM

Hello,

We use grids with filter menus, and we need to implement this behavior: When the user focus out of a filter or open another filter without clearing or applying the current opened filter, the state of the filter (value entered, operator) should be maintained, or at least the filter should remain open until it is manually closed. The default Filter Menu behavior is that on blur it is automatically closed, and all values are lost when it is opened again. In the jQuery grid, the state of the filter is maintained, so we try do the same for Angular grid.

I searched the documentation to find if there is any property to achieve this, but didn't find any. Is there any possibility or workaround to make this work?

Thanks, 

Iuliana

3 Answers, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 28 Sep 2021, 07:44 AM

Hi Iuliana,

I can confirm that the described behavior of the filter menu is expected. Basically each time the filter menu is opened it displays the currently applied filter to the column. If the filter menu displayed a previously entered value, which isn't applied as a filter, then this could cause some confusion to the user.

What could be done to achieve the desired behavior is to create a custom filter menu component. However such approach is more complex to achieve as it leaves the control in the hands of the developer to create the content of the filter menu. That will further allow controlling the value of the filter input once the filter menu is opened.

Please see the following article demonstrating a guideline how to create a custom filter menu component:

https://www.telerik.com/kendo-angular-ui/components/grid/filtering/reusable-filter/#toc-multi-checkbox-menu-filtering

The same approach should be followed when any custom filter menu component should be created. I hope the suggestion helps. Please let me know in case any further information or assistance is required for this case.

Regards,
Svet
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Iuliana Maria
Top achievements
Rank 1
Iron
answered on 30 Sep 2021, 06:04 AM

Hi Svet,

Thank you for your answer! 

Yes it looks like a complex solution, but I will try to implement it if there is no other way.

The big problem in my case is that if the user clicks outside the filter by mistake, it looses all of his changes before applying the filter -  maybe there is something I can do to keep the filter popup open until the user applies the filter or close it manually?

 

Thanks,

Iuliana

0
Svet
Telerik team
answered on 04 Oct 2021, 12:16 PM

Hi Iuliana,

What else could be done is to use the SinglePopupService as demonstrated on the following article:

https://www.telerik.com/kendo-angular-ui/components/grid/filtering/reusable-filter/#toc-filter-menu-with-popup

Please see the following example, based on the approach demonstrated in the referenced article, where the filter menu won't close when clicking on the Grid or on the body element of the page:

https://stackblitz.com/edit/angular-dtzb1c?file=app%2Fapp.component.ts

I hope this helps.

Regards,
Svet
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Iuliana Maria
Top achievements
Rank 1
Iron
Answers by
Svet
Telerik team
Iuliana Maria
Top achievements
Rank 1
Iron
Share this question
or