Kendo Angular Spreadsheet directive creates duplicates records

2 posts, 0 answers
  1. Nicolas
    Nicolas avatar
    1 posts
    Member since:
    Nov 2015

    Posted 09 Nov 2016 Link to this post


    I'm having the following problem with Kendo Angular Spreadsheet directive:

    When I add two lines(2 and 3 for example) on the spreadsheet and then call dataSource.sync(), if line 2 returns an error from the server and the line 3 a success, and I call dataSource.sync() again, line 3 will be created again. When looking at the network calls, I can see that 2 POST requests are sent every time, even if one line was successfully created.

    I made some research on this forum and found this post which describes a similar problem with a grid:

    But I checked and my server returns the newly inserted item, but it seems that the dataSource does not update its internal data.

    When I add 2 lines and the 2 POST requests return a success, the spreadsheet update correctly its internal data, and if I call dataSource.sync() again, no more POST requests will be made.

    Thanks !

  2. Stefan
    Stefan avatar
    2912 posts

    Posted 10 Nov 2016 Link to this post

    Hello Nicolas,

    The described issue was not reproducible in my testing scenarios.

    Usually,  an issue similar to the described one can be caused by an incorrect server response after the Create action is performed. If an incorrect response is received from the server the Create action will be unsuccessful. The Kendo UI DataSource instance will still treat the recently added items as new, and it will try to send them again with every new create request, which duplicates records on the client. The following documentation section explains what is the expected response for create requests:
    But as you mentioned that the server is returning success in other scenarios, I can assume that the issue is different.

    Also, please check the known limitations of the Spreadsheet dataSource to check if some of then are present in your implementation:

    Could you please, send a runnable example reproducing the issue so I can provide a suggestion best suited for it. 

    Telerik by Progress
    Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
Back to Top