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

Odd behavior with kendo multiselect

5 Answers 229 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 25 Feb 2014, 10:53 AM
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?

5 Answers, 1 is accepted

Sort by
0
Sean
Top achievements
Rank 1
answered on 25 Feb 2014, 12:10 PM
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.

0
Georgi Krustev
Telerik team
answered on 25 Feb 2014, 01:23 PM
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!
0
Sean
Top achievements
Rank 1
answered on 26 Feb 2014, 05:16 AM
ok. but it still it isn't clear...
doing the same thing by mouse has no problems. It only happens on keyboard.
0
Accepted
Georgi Krustev
Telerik team
answered on 26 Feb 2014, 02:54 PM
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!
0
Sean
Top achievements
Rank 1
answered on 27 Feb 2014, 05:17 AM
Thanks for your help.
Tags
MultiSelect
Asked by
Sean
Top achievements
Rank 1
Answers by
Sean
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or