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

Unusual behaviour using 'splice' on an obvserableArray

1 Answer 11 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
London TIO
Top achievements
Rank 1
London TIO asked on 27 Mar 2014, 09:23 PM
Hello,

When I remove an item from an array using splice, as per your examples, it appears that two items are being removed from the array rather than just one.
I've created an example below:

http://trykendoui.telerik.com/iBec

It seems to be caused by using the 'set' command against the array:

viewModel.set('data.files', fileCollection);

Am I using the set command in the wrong way?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 28 Mar 2014, 02:27 PM
Hi,

Thank you very much for bringing this to our attention - indeed, the issue is caused by the set call. We are going to fix it - meanwhile you can avoid it by using the following setter:

viewModel.data.set('files', fileCollection);

I am updating your telerik points for your help. 

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