Datasource error event does not fire

2 posts, 0 answers
  1. Tim
    Tim avatar
    10 posts
    Member since:
    May 2014

    Posted 06 Jan 2015 Link to this post

    I've read many Telerik and stack overflow responses to this issue that still don't cover the answer to my question. Yes my error event handler is declared as part of my datasource configuration along with my requestEnd and change event handlers and they work. So my question is this, does the error event get canceled when the requestEnd event is declared?

    My datasource is defined below for any critique you may have

    $(document).ready(function () {

            var dataSource = new kendo.data.DataSource({
                transport: {
                    cache: false,
                    dataType: 'json',
                    contentType: 'application/json; charset=utf-8',
                    read: {
                        url: '/Telecom/Read',
                        type: 'POST',
                        complete: function (jqXHR, textStatus) {
                            
                            //$j('#message').text('Successful Read');
                            //$j('#dialog').dialog("option", "title", textStatus);
                            //$j('#dialog').dialog('open');
                        }
                    },
                    create: {
                        url: '/Telecom/Create',
                        type: 'POST',
                        complete: function (jqXHR, textStatus) {
                            //refreshGrid();
                            //$j('#message').text('Successful Create');
                            //$j('#dialog').dialog("option", "title", textStatus);
                            //$j('#dialog').dialog('open');
                             
                        }
                    },
                    update: {
                        url: '/Telecom/Update',
                        type: 'POST',
                        complete: function (jqXHR, textStatus) {
                            //refreshGrid();
                            //$j('#message').text('Successful Update');
                            //$j('#dialog').dialog("option", "title", textStatus);
                            //$j('#dialog').dialog('open');
                            
                        }
                    },
                    destroy: {
                        url: '/Telecom/Destroy',
                        type: 'POST',
                        complete: function (jqXHR, textStatus) {
                            //refreshGrid();
                            //$j('#message').text('Successful Delete');
                            //$j('#dialog').dialog("option", "title", textStatus);
                            //$j('#dialog').dialog('open');
                            
                        }
                    },
                },
                error: onError,
                requestEnd: onRequestEnd,
                change: onChange,
                serverPaging: false,
                autoSync: false,
                schema: {
                    model: {
                        id: 'Id',
                        fields: {
                            Id: { editable: false },
                            Name: { type: 'string', validation: { required: true } },
                            Category: { type: 'string', validation: { required: true } },
                            EquipmentType: { type: 'string', validation: { required: true } },
                            Description: { type: 'string' },
                            Length: { type: 'number', validation: { required: true } },
                            Height: { type: 'number', validation: { required: true } },
                            Width: { type: 'number', validation: { required: true } },
                            CanEditLength: { type: 'boolean', validation: { required: true } },
                            CanEditHeight: { type: 'boolean', validation: { required: true } },
                            CanEditWidth: { type: 'boolean', validation: { required: true } },
                            IsObsolete: { type: 'boolean', validation: { required: false } },
                            SortOrder: { type: 'number', validation: { required: false } }
                        }
                    }
                }
            });    ....   });



  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 08 Jan 2015 Link to this post

    Hello Timothy,

    The error event is not getting canceled when requestEnd event is declared. Please note that the requestEnd event will be fired even if there is an error with the request, however the error information is only available as part of the error event handler.

    Regards,
    Kiril Nikolov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top