如何根据下拉选择设置单选按钮值?

时间:2015-06-25 17:58:55

标签: javascript angularjs kendo-ui

我想根据下拉选项设置单选按钮值,让我们假设我在下拉列表中有三个值(A,B和C),如果选择了A或B,我想将单选按钮的默认值设置为摘要,如果选择了C,我想将设定值设置为详细。当A&选择B我想让它不可编辑.. 请帮助这是我第一次使用AngularJS的无线电。

main.html

$scope.assessmentType = function() {
                        $scope.riskAssessmentDTO.assessmentName = '';
                        $scope.riskAssessmentDTO.erhFlag = 'Y';

                        $scope.showRefineERH = false;
                        if ($scope.riskAssessmentDTO.scopeType === 'RA_GEO_LOCAT') {
                            $scope.disableAssessmentType = true;
                            $scope.riskAssessmentDTO.erhFlag = 'summary';
                        } else if ($scope.riskAssessmentDTO.scopeType === 'RA_LEGAL_ENTITY') {
                            $scope.disableAssessmentType = true;
                            $scope.riskAssessmentDTO.erhFlag = 'summary';
                        } else if ($scope.riskAssessmentDTO.scopeType === 'RA_BUS_UNIT') {
                            $scope.disableAssessmentType = false;
                            $scope.riskAssessmentDTO.erhFlag = 'detailed';
                        } 
                    };

main.js

$dql = "SELECT g FROM {$this->_entityName} g WHERE g.status = 1 AND REGEXP(g.name, '^[^[:alpha:]]') = 1";

1 个答案:

答案 0 :(得分:1)

Use ng-disabled in Radio buttons and use a scope variable as $scope.selectedIndex to set it as false or true

<input type="radio" ng-disabled="selectedInderx==0">

and set $scope.selectedIndex in the ng-change function in Select by passing $index from html