4

我正在尝试将 kendoNotification 与 kendoWindow 一起使用。我可以工作,但是 kendoWindow 后面的 kendoNotification 显示。我尝试更改两者的 z-index 但无济于事。如何让 kendoNotification 显示在 kendoWindow 顶部?

相关代码

    displayNotes.data("kendoWindow").content(
            "<div>" +
            "<span id='popupValidation'></span>" +
            "  <input type='hidden' id='NoteDate' value=''  />" +
            "  <input type='hidden' id='NoteID' />" +
            "  <div style='margin:5px'>" +
            "    <label>Subject: </label>" +
            "    <input type='text' class='search1'; " +
            "      style='width: 300px; float:right;'" +
            "      id='Subject' ></input>" +
            "  </div>" +
            "  <div style='margin:30px 5px 5px 5px;'>" +
            "  <label style='margin-left:15px;'>Detail: </label>" +
            "  <textarea id='Detail' style='width: 304px;  float:right; height: 155px;'> </textarea>" +
            "  </div>" +
            "  <div style='margin-top:160px;' align='center'>" +
            "    <a onclick='SaveNewNote()'  style='width: 70px;' class='k-button'>Save</a>" +
            "    <a onclick='CloseNoteWindow()'  style='width: 75px;' class='k-button'>Cancel<a/>" +
            "  <div>" +
            "</div>").title("Add Note");
    displayNotes.data("kendoWindow").open().center();
});

function SaveNewNote(message)
{

    var popupNotification = $("#popupValidation").kendoNotification().data("kendoNotification");

    popupNotification.setOptions({
        position: {
            top: 260,
            left: Math.floor($(window).width() / 2 - 110),
            bottom: 0,
            right: 0
        }
    });
    popupNotification.show(message, "error");
}
4

1 回答 1

11

我遇到了同样的问题,并在 Kendo UI 论坛中提出了这个问题,得到的答案是使用 onShow 事件处理程序在 CSS 中设置 z-index。将您的代码更改为以下内容,它应该可以工作:

popupNotification.setOptions({
  position: {
    top: 260,
    left: Math.floor($(window).width() / 2 - 110),
    bottom: 0,
    right: 0
  },
  show: onShow
});

function onShow(e) {
  e.element.parent().css({
    zIndex: 22222
  });
}
于 2014-06-19T10:51:26.993 回答