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

DataSource.remove() performance issues

1 Answer 175 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Johannes
Top achievements
Rank 1
Johannes asked on 14 Apr 2016, 07:38 AM

Hi,

I'm working with Angular and Kendo UI. I want to update an extising grid through an ajax call. I had to iterate over all items in datasource and compare them with the result of ajax call. If i got the item from the response, i had to update, if not i had to delete the item from the grid. Update works fine, if I doesnt use the getter and setter from the model. Now i only got problems with removing the items.

At first I changed the change event for the grid like preventDefaults, if im updating. Now my execution time was shrinking from ~100s to 13s. I tried the same for the datasource but it doesnt work.

Over all I got ~ 1200 items in my grid. I had to delete ~ 600. The average time per removing is 20ms, so the whole update takes 13sec and the most impact is located at the remove.

Is there any way to speed up the remove without recreate the datasource. If I recreate the datasource, i loose the focus and cant easyily reselect the items.

Thanks for your help.

 

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 18 Apr 2016, 06:58 AM
Hello,

Have you tried using the push methods that can update more than one record? For example:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-pushDestroy

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Johannes
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or