0
我想填充我的劍道,組合框與服務器的數據,但不工作。這裏是我的情況:劍道,組合框與angularjs
- 我有3個劍道-COMBO在頁面上 - 盒,都具有相同的K-數據源
- 每個人有不同的NG-模型
所以,當我嘗試從服務器獲取的ID值和使用放在他們ng-model,第一個組合框可以正常工作,但其他組件不會自動選擇該值。這裏是我的代碼HTML:
<div class="row">
<div class="col-md-6">
<div class="form-group has-feedback" ng-class="{ 'has-error': DataForm.coordinator.$invalid, 'has-success': !DataForm.coordinator.$invalid }">
<label class="control-label">Coordinator</label>
<br />
<select kendo-combo-box
name="coordinator"
k-placeholder="'Select a coordinator'"
k-data-text-field="'Name'"
k-data-value-field="'Id'"
k-filter="'contains'"
k-auto-bind="false"
k-min-length="3"
k-data-source="coordinators"
ng-model="item.IdUserCoordinator"
style="width: 100%" required></select>
</div>
</div>
<div class="col-md-6">
<div class="form-group has-feedback" ng-class="{ 'has-error': DataForm.sendto.$invalid, 'has-success': !DataForm.sendto.$invalid }">
<label class="control-label">Send To</label>
<br />
<select kendo-combo-box
name="sendto"
k-placeholder="'Select a user'"
k-data-text-field="'Nome'"
k-data-value-field="'Id'"
k-filter="'contains'"
k-auto-bind="false"
k-min-length="3"
k-data-source="responsible"
ng-model="item.IdUserResponsible"
style="width: 100%" required></select>
</div>
</div>
</div>
這裏是我的腳本:
then(function (data) {
//I have more code here data[0] and data [1]
$scope.coordinators = new kendo.data.DataSource();
$scope.responsible = new kendo.data.DataSource();
$scope.coordinators.data(data[2]);
$scope.responsible.data(data[2]);
var response = RPC.obj.get({ id: $scope.id }); //Get my object from the server
response.$promise.then(function (data) {
$scope.item = data;
});
}
謝謝!