我創建一個輸入數據形式的圖像上添加項目: 多選擇列表
當我在inputext1進入國家的數據,然後在下面的SelectList加載數據約狀態,所以我可以選擇的狀態。當我創建每行表單數據輸入時它工作正常。但是如果我創建多個行表單數據輸入,我得到的數據狀態是我選擇的最終國家狀態結束。
我InputText1:
<span editable-text="data.country" e-name="country"
e-typeahead-wait-ms="100"
e-typeahead="country in countries | filter: $viewValue | limitTo:8" e-typeahead-on-select='onSelect($item)'
e-ng-readonly="isDisable(data)" e-form="rowform"
onbeforesave="validateCountry($data)" e-required class="dropdown"
on-toggle="toggled(open)"> <a href class="dropdown-toggle">
{{ data.country }} </a>
</span>
我的SelectList:
<span editable-select="data.states" e-name="states" ng-width="30px"
e-form="rowform" e-ng-readonly="isDisable(data)"
e-ng-options="states.id as states.name for states in statesArr "
e-required></span>{{showStatesName(data.states)}}
我的JS:
$scope.data = [];
$scope.countries = [];
$scope.statesArr = [];
$scope.loadData = function() {
$http.get(loadDataURL, config).success(function(data) {
$scope.totalItems = data.totalItems;
$scope.data = data.pageItems;
$http.get(getCountriesURL, config).success(function(data) {
$scope.countries = data;
});
});
};
$scope.onSelect(item) {
$http.get(getStatesURL, config).success(function(data) {
$scope.statesArr = data;
});
}
是否有任何建議,爲創建多行形式的數據?