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

[Solved] Grid - GRUD - Custom Reponse

3 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 12 Nov 2014, 11:54 AM
Hello,

I'm using the Kendo UI Grid and i cannot find any documentation about how to customize the response message when updating a row. This is what i found: http://docs.telerik.com/kendo-ui/framework/datasource/crud

But it says: 


The update service expects the edited data item(s) and should return the same item(s) as a confirmation of the successful save operation. An empty response is also treated as a valid success response.



Can i change this behaviour?

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 14 Nov 2014, 08:46 AM
Hi Oliver,

It is possible to add some custom fields to the reponse's JSON string, however removing the expected values would prevent the DataSource from registering the operation as successful. Would you please share more details about your scenario? Getting a better understanding of the problem you are solving would help us provide you with a good solution or a workaround.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Oliver
Top achievements
Rank 1
answered on 14 Nov 2014, 08:59 AM
Hi Alexander,

our response JSON looks like this:

{
  "executiontime": 1,
  "result": 1,
  "message": "Erfolgreich!"
}

The Response was successful when the server returns: result = 1

0
Alexander Popov
Telerik team
answered on 14 Nov 2014, 03:04 PM
Hello again Oliver,

In case the Grid is using a model that does not have the fields you listed below, then the DataSource will not be properly updated using that response. You can still send the actual item and include the below object as an additional parameter. For example: 
{"ProductID":1,"ProductName":"Chai2","UnitPrice":18,"UnitsInStock":39,"Discontinued":false, "status": {   "executiontime": 1,   "result": 1,   "message": "Erfolgreich!" }}

You can then use the DataSource's requestEnd event to capture the "status" object through the e.response argument.

Regards,
Alexander Popov
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
Oliver
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or