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

Kendo UI dataSource sync on button

3 Answers 240 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Mirza
Top achievements
Rank 1
Mirza asked on 07 Jun 2013, 02:08 PM
i have kendo ui datasource sync.

Here is the link:
http://jsbin.com/uhamer/3

When you click on list, article will show in grid list(down), then if you click again on same article, it will increse quantity +1. In that new dataSource that should be synced, schema.model.id is set to id.

When i click on Send data button, it shows me error.

Firebug:
TypeError: r is undefined

Chrome:
Uncaught TypeError: Cannot read property 'data' of undefined<br>

What am i doing wrong here?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 11 Jun 2013, 12:20 PM
Hello,

The error is thrown because the configuration for the update request is not specified in the transport. The item added to the Grid dataSource is assigned an id that is different than the default value and so the update request will used instead of create. The error is thrown only when clicking twice because in the code the item is modified and the dirty flag is set to true only when the item is already in the Grid data. You should either set the options for the update request or not assign an id for the new item.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daiki
Top achievements
Rank 1
answered on 21 Aug 2015, 04:32 AM

Hi Daniel,

Can you provide a sample with an update feature as I'm facing the same issue.

 

0
Daniel
Telerik team
answered on 24 Aug 2015, 03:13 PM
Hi,

I am not sure if I understand the question but all of the editing demos include the update operation. It is used to update an already existing item on the server.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Mirza
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Daiki
Top achievements
Rank 1
Share this question
or