Multiselect.setDataSource() bug after upgrade to 2015.1.318

4 posts, 0 answers
  1. Scott
    Scott avatar
    14 posts
    Member since:
    Mar 2013

    Posted 18 Mar 2015 Link to this post

    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?
  2. Scott
    Scott avatar
    14 posts
    Member since:
    Mar 2013

    Posted 18 Mar 2015 in reply to Scott Link to this post

    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());
      }
    });
  3. Kendo UI is VS 2017 Ready
  4. Peter
    Peter avatar
    4 posts
    Member since:
    Mar 2015

    Posted 19 Mar 2015 in reply to Scott Link to this post

    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.
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 20 Mar 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready