or
function createListViewEditor(container, options) { var list = _.find(_viewModel.model.LookupListCollection, function(x) { return (x.Id == options.model.StagingControlStageAttributeLookupCollectionId); }); var listItems = []; _.forEach(list.LookupValues, function(x) { listItems.push({ text: x.CustomName, value: x.Id }); }); var lvSource = new kendo.data.DataSource({ data: listItems }); var listView = $('<div />') .appendTo(container) .kendoListView({ dataSource: lvSource, selectable: "multiple", template: kendo.template($('#multiselecttemplate').html()) }).data("kendoListView"); var indices = multiListSelectionHelper(listView.dataSource.data(), options.model.AttributeFieldValue.split(',')); listView.select(indices); listView.bind("change", function(e) { var data = e.sender.dataSource.view(), selected = $.map(e.sender.select(), function(item) { return data[$(item).index()].value; }); options.model.AttributeFieldValue = selected.join(); }); } function multiListSelectionHelper(options, current) { var items = []; _.forEach(options, function (x) { _.forEach(current, function(y) { if (x.value == parseInt(y)) { items.push(x); } }); }); return items; }ds = new kendo.data.HierarchicalDataSource({ data: [ { FolderName: 'Documents', hasChildren: true, expanded: true } ], schema: { data: 'd', model: { id: 'FolderID', hasChildren: 'HasChildren', children: { transport: { read: { url: 'Home.aspx/GetTreeNodes', type: 'POST', contentType: 'application/json; charset=utf-8', }, parameterMap: function(data, operation) { return JSON.stringify({ RootFolder: 'Documents' }) } } } } }});<div id="selectMenu" data-role="view" data-title="Emp-Suc" data-init="selectInit"> <div data-role="header"> <div data-role="navbar"> <a data-role="backbutton" href="#:back" data-align="left">Atras</a> Emp-Suc </div> </div> <ul data-role="listview" data-style="inset"> <li> Compañia <select id="company"> </select> </li> <li> <select id="branch"> </select> Sucursal </li> </ul> </div>function selectInit(){ $("#company").kendoDropDownList({ dataSource: selectMenu_model.getUserBranch(selection_view_model), dataTextField: "Company", dataValueField: "CompanyId" }); $("#branch").kendoDropDownList({ cascadeFrom: "company", dataTextField: "Branch.Name", dataValueField: "Branch.BranchId", dataSource: selectMenu_model.getUserBranch(selection_view_model), autoBind: false }); }