javascript - Kendo UI - 在 requestEnd 中显示通知

标签 javascript kendo-ui kendo-grid

大家好,

关于剑道网格requestEnd如果我打电话 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。函数完成后,变量通知就会丢失(有关变量范围的更多信息,请阅读 https://stackoverflow.com/a/500459/4944034)

我对您的示例进行了微小的更改并收到了通知:

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

关于javascript - Kendo UI - 在 requestEnd 中显示通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54210497/

相关文章:

node.js - 如何导入从 github 安装的具有作用域名称的 npm 模块?

javascript - X轴重新启动 - KendoUI

animation - Kendo MVVM 动画绑定(bind)的选项

javascript - 如何从 AJAX 响应数据渲染 Kendo UI 网格?

css - 如何从使用 Bootstrap 的剑道网格行中删除悬停效果

javascript - 引用错误: User is not defined

javascript - MapBox GL CSP 版本不渲染图 block

javascript - 我无法将外部图像加载到 Canvas 上

javascript - KendoGrid - 隐藏有条件的详细信息列

asp.net-mvc - Kendo:处理Ajax数据请求中的错误