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

Problem with getting/setting selected values

1 Answer 83 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Trinet
Top achievements
Rank 1
Trinet asked on 28 Nov 2013, 09:44 AM
Method value() returns an array reference of selected values which is not a desirable behaviour. Method value() should return cloned array instead.

If I get selected values by calling method value() into variable eg. selectedValues and then later set those selected values by calling value(selectedValues) the control is empty, because kendoMultiSelect is modifying the same array object. I need to clone those array which i think should be done in kendoMultiSelect.value() method.

Please see working example on 

http://jsbin.com/eYUwUqA/1/edit

Best regards

Luka Robnik

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 02 Dec 2013, 09:08 AM
Hello Luka,

In general, Kendo widgets return the original instance and the one can decide whether to use it directly or to clone it. In the case of the MultiSelect widget the value can be easily cloned using the slice() method. Check the updated jsBin demo.

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