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

catch return value of datasource update call

1 Answer 445 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 1
Iron
Iron
Veteran
Morten asked on 20 Sep 2019, 12:19 PM

I have a grid with inline editing, linked to a datasource with a update url like listed below.

How do I catch an error returned by the transport.update ?

Thanks in advance

Regards

Morten

 

$("#grid").kendoGrid({

dataSource: gridDs,

editable: "inline",

...

 

var gridDs = new kendo.data.DataSource({

transport: {

    read: { ... }

    update: { 

                    type: "POST",
                    url: '@Url.Action("Update", "Customers")',
                    dataType: "json",
                    contentType: "application/json; charset=utf-8"

      }

     

 

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 24 Sep 2019, 09:57 AM

Hello, Morten,

The built-in error handling mechanism is with an error handler attached to the data source. For the error event to be triggered, use the schema to map where the errors are in the server response. If that response field exists in the response, the error event will be triggered:

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/schema#schemaerrors

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

I have a forum post with a runnable example showing sample custom error response and popup editing that you can check here:

https://www.telerik.com/forums/prevent-kendo-ui-grid-popup-editor-from-closing-after-validation-errors#lYi31IRhR0m4MmqxhSyW5g

In case you have something else in mind, please do not hesitate to get back to me.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Morten
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or