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

How to catch timeout and errors from a get in DataSource?

1 Answer 481 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 23 Feb 2013, 06:28 PM
Hi

I've got the following code, but it's not clear to me how I respond to errors when the get fails (e.g. server down).  It's also not clear to me how I should handle a request time out condition?

Are there methods I can hook into (like the click: handler) to help catch these conditions?

Here's the code.
    return new kendo.data.DataSource({
        serverFiltering:true,
        serverPaging:true,
        serverSorting:true,
        pageSize:20,
 
        transport:{
            read:{
                url:getContentsListURL() // returns a URL of course!
            }
       },
 
        schema:{
            data:"items",
            total:"total_results"
        }
    });
});

Thanks.
--
John Clayton

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 26 Feb 2013, 01:02 PM
Hello,

In order to trap error raised during DataSource read and sync Ajax requests, you may use its error event.

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or