如何为kendo.Window()指定自定义CSS类?

时间:2018-08-10 21:27:30

标签: jquery css telerik kendo-window

我构建了kendoWindow,并且需要为其标题创建自定义类,因此我不使用telerik提供的通用类。

这是我的窗口

$("#win").kendoWindow({
    visible: false,
    modal: true,
    title: true,
    open: function (e) { $("html, body").css("overflow", "hidden"); },
    close: function (e) { $("html, body").css("overflow", ""); },
    draggable: false,
    width: 950,
    height: 510,
    position: {
        top: 100,
        left: 500
    },
    resizable: false
}); 

它生成以下html:

enter image description here

我正在寻找一种使用自己的类而不是使用现有的k-window-titlebar k-header

来修改标题生成方式的方法

我该怎么做?

1 个答案:

答案 0 :(得分:0)

下面是如何在Kendo UI中自定义任何CSS类的方法:

//You need to first make sure the window is initialized - if you are not using Kendo wrappers 

$("#myWindow").kendoWindow({
  // put your settings here
});

// Now you can add a custom CSS class after window initialization

var winObject = $("#myWindow").data("kendoWindow");
winObject.wrapper.addClass("myCustomClass");

// Here you can add a custom CSS class in the open event handler

function onWindowOpen(e) {
    e.sender.wrapper.addClass("myCustomClass");
}

让我知道您的结果!

相关问题