Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Combobox AngularJS ng-model binding issue

$
0
0

I have two comboboxes on the same app view. One works properly and the other one doesn't.

 The issue is that the workOrderType combo isn't showing the selected/existing value that's already in the object source. The selections are in the dropdown/combo correctly, but when it loads it shows only the placeholder.

Below is my relevant code. I'm omitting the part that loads the original item. When I do a  pause on the javascript, I can see that detail.WorkOrderTypeId does have a correct value. Any ideas what might be causing this?

 

$scope.statusComboOptions = {
    dataSource: newkendo.data.DataSource({
        data: []
    }),
    placeholder: "Select a Status",
    filter: "startswith",
    dataTextField: "Description",
    dataValueField: "Id"
}
 
$scope.workOrderTypeComboOptions = {
    dataSource: newkendo.data.DataSource({
        data: []
    }),
    placeholder: "Select a Work Order Type",
    filter: "startswith",
    dataTextField: "Description",
    dataValueField: "Id"
}
 
varasyncPromises = [];
 
asyncPromises.push(workOrdersService.getStatuses().then(function(data) {
    $scope.statusComboOptions.dataSource.data(data);
}));
 
asyncPromises.push(workOrdersService.getWorkOrderTypes().then(function(data) {
    $scope.workOrderTypeComboOptions.dataSource.data(data);
}));
 
$q.all(asyncPromises).then(function() {
    $scope.asyncResolved = true;
});
 

 

<divclass="control-group">
    <label>Status</label>
    <selectkendo-combo-box
            k-options="statusComboOptions"
            ng-model="detail.StatusId"
            k-ng-delay="asyncResolved"></select>
</div>
<divclass="control-group">
    <label>Work Order Type</label>
    <selectkendo-combo-box
            k-options="workOrderTypeComboOptions"
            ng-model="detail.WorKOrderTypeId"
            k-ng-delay="asyncResolved"></select>
</div>

Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>