1
2つのドロップダウン選択ボックスがあります。私はAngularJSを使用してドロップダウンにオプションを表示しています。select2()を使用してドロップダウンで選択したオプションを表示
私のスクリプトでは、$(".select2_demo_1").select2();
を使用すると、一度に1つのドロップダウンが選択されたオプションを表示します。選択肢を表示するために両方のドロップダウンを表示したい。親切に助けが必要です。
<select id="one" class="select2_demo_1 form-control" ng-model="orgs" ng-options="item.OrganizationTypeTitle for item in organization"></select>
<select id="two" class="select2_demo_1 form-control" ng-model="industry" ng-options="i.IndustryTypeTitle for i in industries"></select>
var getOrganizationTypes = OrgService.getOrganizationTypes();
getOrganizationTypes.then(function (response) {
$scope.organization = response.data;
$scope.orgs = $scope.organization[0];
}, function() {
alert('can not get Organization Types!');
});
var getIndustryTypes = OrgService.getIndustryTypes();
getIndustryTypes.then(function (response) {
$scope.industries = response.data;
$scope.industry = $scope.industries[0];
}, function() {
alert('can not get industry types');
})