如何使用kendoWindow显示kendoNotification

时间:2014-06-05 13:30:39

标签: kendo-ui kendo-window

我正在尝试将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");
}

1 个答案:

答案 0 :(得分: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
  });
}