剑道列过滤器中的角度材料日期选择器问题

时间:2021-07-27 08:09:02

标签: angular kendo-ui angular-material datepicker kendo-grid

我有一个剑道网格列过滤器的模板,我在其中使用材料日期选择器来选择日期。

当剑道网格位于材质对话框内时发生的问题。

Issue

正如您在图像上看到的,mat datepicker 出现在过滤器后面。发生这种情况是因为 mat-datepicker 对话框正在 cdk-overlay 中实例化,在包含网格的同一个 div 中,因此它们共享相同的 Z-index。

Inspector code

并且在 app.component 中实例化了 kendo-grid 过滤器。

Inspector code 2

我认为我们有两种可能的解决方案:在 cdk-overlay div 内实例化过滤器的 kendo-popup 或将 mat-datePicker 移动到具有更高 z-index 的 kendo-popup 旁边。

如果我使用 kendo-datepicker,则不会发生此问题,因为它在 kendo-popup 旁边实例化,但我需要 mat-datepicker 来满足设计要求。

Inspector code 3

提前致谢,

V

1 个答案:

答案 0 :(得分:0)

我的问题已在 Telerik 论坛中得到解答。我必须将以下代码附加到网格的 @Component 中。通过此修改,当我在弹出窗口中使用我的网格时,kendo-popup 会在 cdk 叠加层中实例化。

providers: [
    {
      // Provide the current component element as Popup container.
      provide: POPUP_CONTAINER,
      useExisting: ElementRef,
    },
    // Create a new Popup Service that uses the provided container.
    PopupService,
  ],