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

Kendo Angular Spreadsheet directive creates duplicates records

1 Answer 96 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Nicolas
Top achievements
Rank 1
Nicolas asked on 09 Nov 2016, 09:40 AM

Hello,

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: http://www.telerik.com/forums/kendo-ui-grid-inserts-updates-create-duplicate-records#5qPMIWOM4UmWkpStr_17Ag

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 !

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 10 Nov 2016, 03:11 PM
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 requests:

http://docs.telerik.com/kendo-ui/framework/datasource/crud#create-remote
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:

http://docs.telerik.com/kendo-ui/controls/data-management/spreadsheet/import-and-export-data/bind-to-data-source

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

Regards,
Stefan
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.
 
Tags
Spreadsheet
Asked by
Nicolas
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or