Prevent Kendo grid popup edit from closing on Error -


i trying handle server error when creating/updating/deleting item kendo grid. when error thrown, kendo grid closes no matter what.

  function kendo_error_handler(e) {         if (e.errors) {             var message = "errors:\n";             $.each(e.errors, function (key, value) {                 if ('errors' in value) {                     $.each(value.errors, function () {                         message += + "\n";                     });                 }                 showerrormessages(key, message);             });              //this not work           var grid = this;           gird.one("databinding", function (e) {              e.preventdefault();           });         }     } 

does have other solution? e.preventdefault() doesn't work either.

this worked me. in case needs this.

function kendo_error_handler(gridname) {         return function (e) {             if (e.errors) {                 var grid = $('#'+gridname).data("kendogrid");                 grid.one("databinding", function (ev) {                     ev.preventdefault();                     var message = "errors:\n";                     $.each(e.errors, function (key, value) {                         if ('errors' in value) {                             $.each(value.errors, function () {                                 message += + "\n";                             });                         }                         showerrormessages(key, message);                     });                 });             }             else {                 $("#errorcontainer").text("");             }         }     } 

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -