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
$(
"#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());
}
});
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
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);
}
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/.