0

After the Kendo UI ASP.NET MVC library to the latest version the following code doesn't work:

function Error(e)
{
   var gridName = this.options.table.context.id
   var grid = $('#' + gridName).data("kendoGrid");
}

The table property is null. How are we supposed to find the sender from the 'e' which is being passed here.

Thanks

Angad
  • 1,144
  • 3
  • 18
  • 39

1 Answers1

3

There is no error event in the grid API. There is one in the dataSource (which is what I am going to assume you are referencing.)

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-error

This event returns an instance of the dataSource object with the this keyword (You can also access the dataSource with e.sender).

The dataSource is not Grid specific, and it seems Telerik has removed the table property from the dataSource.


This thread has a hack that should get what you want. Get a reference to Kendo Grid from inside the error handler

It is in the updated edit.

Community
  • 1
  • 1