Kendo Multiselect value setting Bug

廉价感情. 提交于 2019-12-03 19:09:50

Before setting new values in a multiselect, you should clean the filter before tagObj.dataSource.filter({});

Your function should be:

function fillData(tagIds){ 

    var tagObj = $("#addTags").data("kendoMultiSelect");
    if (tagObj == undefined) { // if not loaded
        $("#addTags").kendoMultiSelect({
            dataTextField: "label",
            dataValueField: "value",
            dataSource: list,
            value: tagIds, placeholder: "Select from list",
            change: function() {
                // change
            }
        });
    } else { // if already loaded only change the values.
        // Clean DataSource filter before setting new values
        tagObj.dataSource.filter({});
        tagObj.value(tagIds);
        console.log(tagIds);
        console.log(tagObj.value());
    }
}

Your JSFiddle modified here: http://jsfiddle.net/OnaBai/AgV52/2/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!