Problem with matdatepicker in kendo grid filter

1 Answer 260 Views
Grid Popup
Víctor
Top achievements
Rank 1
Víctor asked on 22 Jul 2021, 09:44 AM

Hi,

I have a template for a kendo grid column filter where I use a material datepicker to select a date. 

The issue that is happening when the kendo grid is located inside a material Dialog. 

 

As you can see on the screen, the mat datepicker is appearing behind the filter. That happens because the mat-datepicker dialog is being instantiate in the cdk-overlay, in the same div that contains the grid, so they share the same Z-index.

And the kendo-grid filter is being instantiated inside the app.component. 

I think that we have two possible solutions: instantiate the filter's kendo-popup inside the cdk-overlay div or move the mat-datePicker next to the kendo-popup with a higher z-index.

If I use a kendo-datepicker this issue doesn't happens because it is instantiate next to the kendo-popup but I need the mat-datepicker for designs requirements. 

 

Thanks in advance,

V

Víctor
Top achievements
Rank 1
commented on 26 Jul 2021, 12:14 PM

Hi. Any update about this?

1 Answer, 1 is accepted

Sort by
1
Yanmario
Telerik team
answered on 28 Jul 2021, 12:32 PM

Hi Victor,

Thank you for the provided screenshots.

Indeed the issue seems to be caused in the DOM where different containers are initialized with their corresponded z-index. I recommend using Kendo UI for Angular DatePicker component and adjusting the styles depending on the application requirements(Kendo Material theme can be used).

https://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/

What else can be done is to use the popup container to overlay other applications:

https://www.telerik.com/kendo-angular-ui/components/grid/how-to/scope-grid-popups/

https://stackblitz.com/edit/ng-kendo-grid-filter-menu-mat-datepicker-9rjzkd?file=app%2Fapp.component.ts

I want to mention that mat-dialog and mat-datepicker aren't supported components by Kendo UI for Angular and they have their own documentation and dedicated support. This recommendation(with the demo example) should be used at the developer's own discretion as it's based on a custom implementation.

I hope this helps and steers you in the right direction.

Regards,
Yanmario Menev
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.

Víctor
Top achievements
Rank 1
commented on 28 Jul 2021, 02:26 PM

Thank you very much. It works like a charm.

Now the kendo-popup is instantiated correctly in the cdk-overlay when I use the grid in a popup. :D
Tags
Grid Popup
Asked by
Víctor
Top achievements
Rank 1
Answers by
Yanmario
Telerik team
Share this question
or