There already are questions how to get custom error handling, with answers, but all those answers use 'external' reference/selector to the grid to make it work, for example:
function onError(e) {
if (e.errors) {
var message = "Error:\n";
var grid = $('#gridID').data('kendoGrid'); // <<- here
(...)
}
Is it possible to get the reference to the grid from inside the error handling function without providing the selector by hand or 'externally' (because global variables are meh)? That way the error handling script could be totally self-contained.
I would suggest passing the target grid id as an argument to your function. Example: .Events(events => events.Error("function(args){telerikGridAraxErrorhandler(args,'myGridId');}"))
I think it will result in less support in case they change anything in future versions of Telerik Grid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With