Kendo grid slow saving large data set in batch mode

4 posts, 0 answers
  1. Dan Foster
    Dan Foster avatar
    21 posts
    Member since:
    Jun 2010

    Posted 30 Sep 2013 Link to this post

    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.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 30 Sep 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Dan Foster
    Dan Foster avatar
    21 posts
    Member since:
    Jun 2010

    Posted 01 Oct 2013 Link to this post

    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.
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 02 Oct 2013 Link to this post

    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!
Back to Top
Kendo UI is VS 2017 Ready