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

Integration with Angular JS

3 Answers 215 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Jean
Top achievements
Rank 1
Jean asked on 19 Aug 2014, 04:49 PM
Hi,

I'm trying to bind a MultiSelect with Angular JS using k-ng-model. It seems to work when I select elements, but not when displaying the control (nothing is pre-selected).

Code from Angular controller:
$scope.selectOptions = {
        placeholder: "Select roles...",
        dataTextField: "roleName",
        autoBind: false,
        dataSource: $scope.roles,
         
select: function(e) {
console.log("Event: "+e.item);
}
    };


HTML:
<div data-kendo-multi-select
data-k-options="selectOptions"
data-k-ng-model="user.roles"
style="width: 300px">


3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 20 Aug 2014, 08:03 AM
Hello,

Did you have a chance to look at this online demo? It shows pre-selected items in multiselect with autoBind: false. If your scenario differs from the online demo, could you please create a Kendo Dojo demo reproducing the issue? This will help us to observe the problem locally and advice you further.

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
Jean
Top achievements
Rank 1
answered on 20 Aug 2014, 10:34 PM
Hi Georgi,

I was able to reproduce my issue at http://dojo.telerik.com/ufEl/2

It seems to work fine with primitive values, but not with object. As you can see nothing is pre-selected, however selecting roles work.

Thanks for your help,

Jean
0
Accepted
Georgi Krustev
Telerik team
answered on 21 Aug 2014, 11:39 AM
Hello Jean,

Thank you for the repro demo. Currently, setting array of objects directly to the widget is not supported. Basically, the value of the k-ng-model is directly passed to the value method of the widget, which accepts only an array of primitive values. We will further consider how this scenario should be supported.
For now you will need to use primitive values only.

Regards,
Georgi Krustev
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
Jean
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Jean
Top achievements
Rank 1
Share this question
or