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

multiSelect not showing selected items

2 Answers 202 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Elliot
Top achievements
Rank 1
Elliot asked on 17 Sep 2015, 03:08 PM

I have the following multiselect:

<select kendo-multi-select id="manageCrewSelector" name="manageCrewSelector" ng-model="vm.crew.employeeIds" required 
            k-data-text-field="'fullName'"
            k-data-value-field="'employeeId'"
            k-data-source="vm.employeeList"
            k-filter="'contains'"></select>

I also have a button that when clicked updates the multi select to select the new items selections:

vm.crew.employeeIds = getEmployeeIdsForProject(projectId);

I would expect this to work since angular has two way binding however it didnt​.  Why?

So, I added the following:

var multiSelect = $('#manageCrewSelector').data('kendoMultiSelect');
multiSelect.value(vm.crew.employeeIds);​

Now I can see the items are selected when I scroll through the list however the multi select doesnt show that they are selected.  Again why?

 

2 Answers, 1 is accepted

Sort by
0
Elliot
Top achievements
Rank 1
answered on 17 Sep 2015, 03:39 PM

Quick update.  This issue only happens when I filter the list when selecting a new item.  

If I click the x to remove an item or I select and item by scrolling through the list it works as expected even without setting the value of the widget.  ie: I can just set vm.crew.employeeIds

 

0
Petyo
Telerik team
answered on 21 Sep 2015, 10:18 AM

Hello Elliot,

I am not sure what happens in that case. May you please reproduce it in a Dojo? We will examine it further. Thank you in advance. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MultiSelect
Asked by
Elliot
Top achievements
Rank 1
Answers by
Elliot
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or