This is a migrated thread and some comments may be shown as answers.

Error event paramenter

3 Answers 152 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Allan
Top achievements
Rank 1
Allan asked on 14 Feb 2012, 03:20 PM
Hi all

I'm trying to build in some nice error handling into my datasource for my Kendo grid.

error: function (e) {
    error = JSON.parse(e.responseText);
    alert(error.ErrorMessage);
    dataSource.cancelChanges();
}

When my DESTROY URL returns an error, this works fine.
But when my READ URL returns an error, e contains 3 arguments where the first object is the error object I want to use.

Why is the e object not the same?

Best regards,
Allan

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 15 Feb 2012, 09:05 AM
Hello Allan,

The arguments of the error event is what has been returned from the server and passed to $.ajax error handler.

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joshua
Top achievements
Rank 1
answered on 27 Feb 2012, 01:30 AM
Allan,

Can you post the code that you used to make the error event fire for the different transport operations? For the life of me, I cannot get the events to fire.

Thanks
0
Nikolay Rusev
Telerik team
answered on 27 Feb 2012, 09:34 AM
Hello Joshua,

Returning error status code(for example: status code 500) from server will trigger error event. As mentioned in previous post the error handler is wired to $.ajax error handler.

All the best,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Allan
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Joshua
Top achievements
Rank 1
Share this question
or