Here is my scenario . When the page loads initially , I will select some items from the multiselect and when they go back to the same screen , I need to show those items as already selected . My problem is , if I go back , the widget displays only the last selected item ( sometimes I get all the items in the list, but this is inconsistent ) . I even tried to clear the filter and reset the datasource , but it takes the last filter value and displays only the last selected item( not all the items selected list ) . Please advice on what I am doing wrong .
$scope.init= function()
{
ar kmsList = $('#benchmarkDropDown').data("kendoMultiSelect");
if( kmsList != null )
{
kmsList.dataSource.data(managerInsightsDatabaseFactory.benchmarkObjs);
if( kmsList.dataSource.filter != null ){
kmsList.dataSource.filter({});
}
kmsList.value(managerInsightsDatabaseFactory.benchmarkIds);
kmsList.trigger("change");
}
<select kendo-multi-select id="benchmarkDropDown" class="k-content"
k-options="benchmarkDropdownOptions" ng-disabled="ui.disableBenchmarkMultiSelect" style="width: 100%">
</select>
In the factory
managerInsightsDatabaseFactory.benchmarkDropdown = new kendo.data.DataSource(
{
type: "json",
transport: {
read: "rest/reporting/filteredBenchMarks"
},
valuePrimitive: true,
schema: {
model: {
fields: {
name: { type: "string"},
id: { type: "string" }
}
}
},
pageSize: 100,
serverPaging: true,
serverFiltering: true
});