Kendo Angular multiselect sets selected values

I am using multiselect Kendo with Angular-Kendo directives and with a remote data source. I try to set the selected items when the application starts, but no luck. Can anyone help me out?

See the code here: JS Bin

+1
source share
2 answers

You can simply create a custom directive and pre-pass the elements you want to select into the value attribute of the multiselect directive, look at this Plunk to see the directive I'm using.

+2
source

You need to connect to the on change event directive and send kendoEvent. Then you can use the supported kendo methods on e.sender. Check it out on plunker

  <select id="required" multiple="multiple" kendo-multi-select k-on-change="changed(kendoEvent)"> <option>Steven White</option> <option>Nancy King</option> <option>Nancy Davolio</option> <option>Robert Davolio</option> <option>Michael Leverling</option> <option>Andrew Callahan</option> <option>Michael Suyama</option> <option selected>Anne King</option> <option>Laura Peacock</option> <option>Robert Fuller</option> <option>Janet White</option> <option>Nancy Leverling</option> <option>Robert Buchanan</option> <option>Margaret Buchanan</option> <option selected>Andrew Fuller</option> <option>Anne Davolio</option> <option>Andrew Suyama</option> <option>Nige Buchanan</option> <option>Laura Fuller</option> </select> var app = angular.module('app', ['kendo.directives']); app.controller("myCtrl", function ($compile, $scope) { $scope.changed = function(e) { console.log(e.sender.dataItems()); }; }); 
+1
source

All Articles