0

Greeting All,

On Kendo Grid requestEnd is that possible if I call kendo notification when successful updating record?

In this Demo I try to implement it, but somehow after I updated to record it keep buffering and not displaying the notification.

Can someone help me to solve this problem? Thank you in advance!

I include the function just in case:

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

Nixoderm
  • 355
  • 4
  • 23

1 Answers1

1

The problem is that you are specifying the variable notification within $(document).ready. Once the function finishes, the variable notification is lost (read https://stackoverflow.com/a/500459/4944034 for more information about the scope of a variable)

I did a minor change to your example and got a notification:

var notification;
$(document).ready(function () {
  notification = $("#notification").kendoNotification({
Carsten Franke
  • 1,649
  • 2
  • 13
  • 30
  • ouch! I didn't see that coming. Thank you for notify me about that, i'll take noted after this. – Nixoderm Jan 16 '19 at 07:43
  • Don't forget: you can accept this answer if it was the correct or useful solution. Read more about accepting answers on https://stackoverflow.com/tour – Carsten Franke Jan 17 '19 at 20:12