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

Kendo grid slow saving large data set in batch mode

3 Answers 228 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan Foster
Top achievements
Rank 2
Dan Foster asked on 30 Sep 2013, 08:22 AM
I have a grid, approx 500 row in it, using remote data.  The grid is declared in MVC helper, rather than JS, but I don't think that matters in for this issue.

I've added a function which updates some of the values within the grid, that works fine:

//I have already tried using grid.dataSource.data() instead of view(), but it doesn't help)
var dataItems = grid.dataSource.view();
 
for (i = 0; i < dataItems.length; i++) {
var dataItem = dataItems[i];
dataItem.Amount = dataItem.OriginalAmount;
dataItem.IsIncluded = true;
 
dataItem.dirty = true;
}
 
grid.dataSource.fetch();   //This shows the dataSource's changed values in the grid

(I deliberately am not using the dataItem.set() method, because it fires the dataSource.change event repeatedly, which makes the js function bomb out if running on many rows.

So the above function works fine, and updates 500 rows in about half a second, which is acceptable.  

The problem comes when I want to save (sync) the changes.  It takes an age, close to a minute before it even calls the controller action to update (as specified for update in the grid definition).

It does work and save/update, but it needs to be faster.  

Is there a way that doesn't take a minute to hit the controller save/update action?  Or is there a better way of doing this?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 30 Sep 2013, 12:12 PM
Hi Dan,

 I tried to reproduce the problem to no avail. Here is the jsbin demo which I tried: http://jsbin.com/ANAJOHa/1/edit

 When I click the button the update is almost immediate.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dan Foster
Top achievements
Rank 2
answered on 01 Oct 2013, 10:24 AM
EDIT: Please see third example: ExampleSlowGridUpdateForTelerik Third.zip where I have reproduced the problem.

After a bit of investigation I thought that it might've been the serveroperation(false) causing the problem, but it doesn't appear to be the case.

NB. I didn't see how to remove the previous attachments.
0
Atanas Korchev
Telerik team
answered on 02 Oct 2013, 06:54 AM
Hi Dan,

 What browser are you using? I tried with Chrome, Firefox and IE10 and the response was almost instant. I recorded a short video which demonstrates the same http://screencast.com/t/KP3Mii2bjt

Regards,
Atanas Korchev
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
Dan Foster
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Dan Foster
Top achievements
Rank 2
Share this question
or