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

Popup Grid Editor Update Causing Update on All Grid Rows

2 Answers 184 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Licensing
Top achievements
Rank 1
Licensing asked on 04 Nov 2015, 05:37 PM
I have a grid bound to a data source using transport functions, and I have enabled editing in popup mode. 

Everything works great, except one odd issue: When I click the "Edit" button for a record, make a change, and click "Update" every record in my grid sends an update request to the server with their current values. The record I intended to edit, was updated as well. This is causing a performance issue. 

I can't begin to work out the issue - all I have done so far is made sure that batch editing is set to false. Where can I begin to look? I'm not sure what code I can share that would be relevant. 

Thanks,
Kevin

2 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 06 Nov 2015, 11:17 AM

Hello Kevin,

 

In general the Kendo UI Grid/DataSource does differentiate create/update operation based on the model id values. If the id value for a specific dataItem is the default value for its type (for example "int" type has a default value "0") it will perform a create operation. Otherwise it will make an update  request (when a new item is created the id value is set to the default value). 

 

So basically if all dataItems have the default value for their id field they will be treated as new items. I am not aware of case when all items are treated as modified items and all of them to be sent to the server for update. 

 

Could you please extract a runnable sample in a Kendo UI Dojo so we can investigate it? 

 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Licensing
Top achievements
Rank 1
answered on 09 Nov 2015, 03:20 PM

Hi Boyan,

I have identified the issue. The issue was the combination of two things: (1) I wanted custom properties for my grid data source so I create a custom ​data source class which included the Kendo UI DataSource object properties as well as the custom properties I needed. (2) After the grid loaded, I had some ajax calls to retrieve data to update the values in a column for each row in the grid.

To resolve the issue, I used a vanilla JSON object ​for my custom properties instead of a class.

Kevin

Tags
Grid
Asked by
Licensing
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Licensing
Top achievements
Rank 1
Share this question
or