How do I make the multi select default to the first value if there is only one row in the datasource view when the datasource is filtered
In angular i have tried many things, last thing I tried was a watch. Here is code that is not working where ddlRegion is my angular multiselect
$scope.$watch("dsRegions.view().length",
function handledsRegionsChange(newValue, oldValue) {
values = [];
if (($scope.dsRegions.view().length == 1) && ($scope.selectedRegion == null)) {
values[0] = $scope.dsRegions.view()[0].RegionId.toString()
$scope.selectedRegion = $scope.dsRegions.view()[0].RegionId;
$scope.ddlRegion.value(values);
}
}
);