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

datasource update fail on return

1 Answer 269 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Morten asked on 19 Aug 2015, 06:47 AM

I have a grid with editable: "inline" hooked on a datasource pointing to a asp.net mvc controller for its update: update: { url: '@Url.Action("Update", "Account")', contentType: "application/json", type: "POST" }.

I would like the Update method on the AccountController to return json ( public JsonResult Update(int id, string name() { ... return ​Json() } ), however if the Update method returns anything but a single digit I'm getting the client side error: "Uncaught SyntaxError: Unexpected number" and clicking the script reference gives me this code: (function(d,value /**/) { d.0=value })

What is wrong?

 

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 21 Aug 2015, 07:11 AM

Hello Morten,

 

I'm not sure about the exact cause for the issue you are facing. However, you should verify that the object returned by the update action method have the same structure as the one declared in the DataSource schema - its format should match the response returned by the read method. The actual data should contain only the updated items. Additional information on how to setup the DataSource for CRUD operations can be found in this help topic.

If you continue experiencing difficulties please provide more details about the Grid's declaration as well as other associated code such as the server Controller.

 

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Rosen
Telerik team
Share this question
or