You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为Kendo Window添加遮罩禁用后台交互?modal属性设置无效

Kendo UI Window 模态化配置修正

你之前通过htmlAttributes设置modal属性的方式不对,Kendo UI Window的模态行为是通过组件自身的配置项直接开启的,不需要放到htmlAttributes里。

修正后的代码如下:

const windowRef = this.windowService.open({
   title: compTitle,
   content: compName,
   cssClass: "menu-window",
   modal: true // 直接添加这个配置项
});

当设置modal: true后,窗口会自动生成遮罩层,禁用后方页面的点击事件,同时不影响你查看窗口后方的数据,完全符合你的需求。

内容的提问来源于stack exchange,提问作者Krishnan Kamalesh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 16:42:08