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

Hitting "Update" fires "create"

2 Answers 461 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CS
Top achievements
Rank 2
CS asked on 04 Jun 2014, 06:37 AM
I have very basic grid using remote date from a MS CRM2013 REST endpoint. I currently try to use inline editing. So I have to click on edit to change row data. When I then change data and hit "Update" I expected that the "update" method is fired but instead "create" and I receive the error "Uncaught TypeError: Cannot read property 'call' of undefined" because I don't have "create" yet. So how can I prevent "Update" fire a "create"?

2 Answers, 1 is accepted

Sort by
0
CS
Top achievements
Rank 2
answered on 04 Jun 2014, 09:54 AM
To get more specific, I have values of null in the table, so the property exists but not the value. When I change the value a "create" is fired since the value did not exist before but actually it should only update the null value to the current. If a value was set before "update" is fired. I only want to fire an "create" if one special cell is filled and "update" otherwise.
0
Alexander Popov
Telerik team
answered on 05 Jun 2014, 03:13 PM
Hi Stefan,

This behavior could be observed in case the Model's ID is not specified. Basically, the DataSource checks the ID of the item being edited, and if it is different than 0 (or the default value of the ID field) then Update is called, otherwise - Create.

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
CS
Top achievements
Rank 2
Answers by
CS
Top achievements
Rank 2
Alexander Popov
Telerik team
Share this question
or