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

Data Source Rollback Issue

4 Answers 122 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Douglas
Top achievements
Rank 1
Douglas asked on 08 May 2013, 03:15 PM
Hi,

I've found a bug that appears when all items are removed from a dataSource. After removing the final item i find that the dataSource has been reset and contains all original items.

To reproduce do the following on your jsfiddle example from  'Adding And Removing Items In kendo.data.DataSource by Kendo UI Team Blog'. Tuesday, January 29, 2013

http://jsfiddle.net/derickbailey/D4g8S/

1. tick all as done
2. remove done items
3. select show complete from dropdown (you'll see one item appears that was removed)
4. select show all from dropdown (all items are back)

Could you please let me know how to fix this?

Regards,
Douglas

4 Answers, 1 is accepted

Sort by
0
Douglas
Top achievements
Rank 1
answered on 08 May 2013, 05:21 PM
if (remote || (that._data === undefined || that._data.length === 0)) {
                that.read(that._mergeState(options));

I believe the items are refreshed when the dataSource is empty and line 2487 kendo.data.js is hit following the removal of the last item.
0
Douglas
Top achievements
Rank 1
answered on 09 May 2013, 05:19 PM
I've got a quick and dirty solution for now, but i'd appreciate some feedback on this.

http://jsfiddle.net/dcam/NPC7q/1/

0
Alexander Valchev
Telerik team
answered on 10 May 2013, 11:43 AM
Hi Douglas,

Thank you for getting in touch with us. This is a know bug - data is re-requested if all items are deleted and query is called with server operations disabled.

I am glad to inform you that the issue is fixed in the latest internal build. Please download it and give it a try.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Douglas
Top achievements
Rank 1
answered on 10 May 2013, 01:40 PM
Thanks, that's good to know.
Tags
Data Source
Asked by
Douglas
Top achievements
Rank 1
Answers by
Douglas
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or