error
Fired when a request to the remote service fails.
The event handler function context (available via the this
keyword) will be set to the data source instance.
If the
schema.errors
option is set and the server response contains that field, then theerror
event will be fired. The
errors
field of the event argument will contain the errors returned by the server.
Event Data
e.errorThrown Object
(optional)
An optional exception.
e.sender kendo.data.DataSource
The data source instance which fired the event.
e.status String
A string describing the type of the error.
e.xhr Object
The current jqXHR
.
Example - subscribe to the error event after initialization
<script>
function dataSource_error(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.status); // displays "error"
}
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "https://demos.telerik.com/kendo-ui/service/"
}
}
});
dataSource.bind("error", dataSource_error);
dataSource.fetch();
</script>
In this article