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

Multiselect.setDataSource() bug after upgrade to 2015.1.318

6 Answers 314 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 18 Mar 2015, 05:19 PM
Sample

In previous the previous version of Kendo I was able to dynamically update the contents of a multiselect list by calling setDataSource with a modified list. After upgrading to 2015.1.318, doing so results in copies of the currently selected item(s) being added to the visible list. The actual selections returned from .value() is still correct, one of each, but what's being rendered is not.

From what I can see in the source, a good bit of the multiselect implementation was redone with this release. I'm assuming this was not the intended behavior, but I was hoping there was maybe a workaround for now until the issue is resolved?

6 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 18 Mar 2015, 06:04 PM
Seems silly, but reassigning the value after changing the datasource seems to be a viable workaround.

$("#button").kendoButton({
  click:
function(e) {
    var ctrl = $("#multiselect").data('kendoMultiSelect');
    var data = ctrl.dataSource.data();
    data.push(
'Another Item');
    ctrl.setDataSource(
new kendo.data.DataSource({ data: data }));

    //
workaround
    ctrl.value(ctrl.value());
  }
});
0
Peter
Top achievements
Rank 1
answered on 19 Mar 2015, 05:08 PM
I appreciate the workaround! I was having a similar issue with the duplication and not being able to visually rid the input box of old elements. The workaround helped, but for some reason when I'd change my dataSource and call the workaround command, it would occasionally clear out everything, regardless of what was supposed to be in there. I got around this by adding a conditional in the multiSelectBox's change event and then running the workaround there.
0
Georgi Krustev
Telerik team
answered on 20 Mar 2015, 10:09 AM
Hi,

Thank you for drawing our attention to this issue. I logged in our Github repository and will try to fix is for the next internal build scheduled for next week.

As a gratitude for your involvement I updated your Telerik points.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Garry
Top achievements
Rank 2
Veteran
answered on 30 Jan 2021, 11:08 AM

I have just noticed this bug in the last 202 release:

This throws an error:

var widget = $('#' + sFieldID).data("kendoMultiSelect");
            if (widget)
            {
                var dataSource = new kendo.data.DataSource({
                    data: dataValueTextArray
                });
                widget.setDataSource(dataSource);
            }

0
Garry
Top achievements
Rank 2
Veteran
answered on 30 Jan 2021, 11:10 AM
Sorry - specific release with bug: Kendo UI v2020.3.1118
0
Neli
Telerik team
answered on 02 Feb 2021, 03:12 PM

Hello Garry,

I have tested locally the behavior when using the setDataSource method of Kendo MultiSelect. However, there is no error on my side with both versions 2020.3.1118 and also with the latest 2021.1.119. Here is a Dojo example where you could test the behavior. Please let me know if I am missing something. Could you please provide us the needed steps for replicating the issue? I would appreciate it if you could modify the Dojo in order to replicate the same behavior as it is at your side and send it back to us for a review. 

Looking forward to your reply.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
MultiSelect
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Georgi Krustev
Telerik team
Garry
Top achievements
Rank 2
Veteran
Neli
Telerik team
Share this question
or