Kendo UI - 在requestEnd中显示通知

Kendo UI - Displaying notification in requestEnd

大家好,

在 Kendo 网格上 requestEnd is that possible if I call kendo notification 何时成功更新记录?

this Demo 中,我尝试实现它,但不知何故,在我更新记录后,它一直在缓冲而不显示通知。

有人可以帮我解决这个问题吗? 提前致谢!

为了以防万一,我加入了函数:

function KendoAlert(content) {
  $("<div></div>").kendoAlert({
    title: "Messages!",
    content: content
  }).data("kendoAlert").open();
}   

function KendoNotify(message) {
  notification.show({
     message: message
  }, "upload-success");
}

function onRequestEnd(e) {
  debugger;

  if (e.type == "update" && !e.response.Errors) {
    KendoNotify("Update Done!");
    //KendoAlert("Update Done!");
  }  
}  

Demo In Dojo

问题是您在 $(document).ready 中指定了变量 notification。函数完成后,变量 notification 将丢失(阅读 了解有关变量范围的更多信息)

我对您的示例做了一个小改动并收到了通知:

var notification;
$(document).ready(function () {
  notification = $("#notification").kendoNotification({