Odd behavior with kendo multiselect

6 posts, 1 answers
  1. Sean
    Sean avatar
    13 posts
    Member since:
    May 2012

    Posted 25 Feb 2014 Link to this post

    http://jsfiddle.net/ruchan/AgV52/1/

    Problem replication:
    -click "Init List" and then add new tag to the box by keyboard.
    -now click fill List button [it fills "1,2,3" as selected values].
    - All the values are not being selected. or sometimes only last value is selected
    var list=[{label:'tag1', value:'1'},
             {label:'tag9', value:'9'},
             {label:'tag8', value:'8'},
             {label:'tag7', value:'7'},
             {label:'tag6', value:'6'},
             {label:'tag5', value:'5'},
             {label:'tag4', value:'4'},
             {label:'tag3', value:'3'},
             {label:'tag2', value:'2'}];
     
    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.
            tagObj.value(tagIds);
            console.log(tagIds);
            console.log(tagObj.value());
        }
    }
    function fillaList(){
        var tagIds=[1,2,3];
        fillData(tagIds);
    }
    function clearList(){
        fillData([]);
    }
     

    note: The problem in only when you do the tag selections from keyboard. Doing it by mouse clicks shows no problem

    Is this a bug or i am doing something wrong?

  2. Sean
    Sean avatar
    13 posts
    Member since:
    May 2012

    Posted 25 Feb 2014 in reply to Sean Link to this post

    the problem got solved when setting value.
    tagObj.dataSource.filter({});
    http://jsfiddle.net/ruchan/AgV52/3/
    Still it looks like a bug on part of kendo.

  3. Kendo UI is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 25 Feb 2014 Link to this post

    Hello Sean,

    The described behavior is expected. Please check the value method documentation for more information.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Sean
    Sean avatar
    13 posts
    Member since:
    May 2012

    Posted 25 Feb 2014 in reply to Georgi Krustev Link to this post

    ok. but it still it isn't clear...
    doing the same thing by mouse has no problems. It only happens on keyboard.
  6. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 26 Feb 2014 Link to this post

    Hello Sean,

    When the end users selects items using a mouse input device, the widget's data source is not filtered. If you select items using keyboard without typing - using only UP/DOWN arrow, the widget behaves the same way as the items are selected with a mouse. Once the end user decides to filter the data source, then you will need to clear the applied filter before set value through widget's API. We do not remove data source filters in the widget value method, because it causes unexpected behavior when a remote binding is used. I hope this clarifies the case.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  7. Sean
    Sean avatar
    13 posts
    Member since:
    May 2012

    Posted 26 Feb 2014 in reply to Georgi Krustev Link to this post

    Thanks for your help.
Back to Top
Kendo UI is VS 2017 Ready