繁体   English   中英

AngularJs 未删除复选框后单击单选按钮

[英]AngularJs radion button click after checkbox not removed

我有个问题。 当我单击单选按钮时,复选框已被删除,但我做不到。

<tr ng-show="selectBolum.id!=NULL" ng-repeat="burs in getHesaplama | orderBy:'-tam_oran/1' | filter:{id:selectBolum.id}">
        <td><b>{{burs.burs_adi + ' %' + burs.mat_oran*100 + ' '}}</b>{{burs.aciklama}}</td>
        <td class="text-center">
          <input ng-show="burs.birlestirme=='HAYIR'" type="radio" id="radio" ng-click="newValue(burs.mat_oran)" ng-model="getRadiobtn" name="radiobtn">
          <input ng-show="burs.birlestirme=='EVET'" type="checkbox" ng-change="newDsc(burs.mat_oran,check)" ng-model="check" ng-checked="getRadiobtn">
        </td>
      </tr>

代码

$scope.newValue =function(value) {
      $scope.getKalan = $scope.getUcret;
      $scope.getKalan = $scope.getUcret -(value*$scope.getUcret);
      $scope.check=false;
   }
   $scope.newDsc =function(value,check) {
     if (check == true) {
      if ($scope.getKalan == 0) {
       $scope.getKalan = $scope.getUcret;
     }
     else{
      $scope.getKalan = $scope.getKalan - (value*$scope.getUcret);
     }
     }
     else{
      $scope.getKalan = $scope.getKalan + (parseFloat(value)*$scope.getUcret);
     } 
   }

添加以下更改: https://stackblitz.com/edit/angularjs-jmgsy5?file=index.html

$scope.checkBoxStatus = [];
        $scope.newValue =function(value) {
          $scope.getKalan = $scope.getUcret;
          $scope.getKalan = $scope.getUcret -(value*$scope.getUcret);
          $scope.check=false;
          $scope.checkBoxStatus = [];
          //$( "input[type='checkbox']" ).prop( "checked", false );
       }

 $scope.getReset = function () {
        $scope.getKalan = $scope.getUcret;
        $scope.checkBoxStatus = [];
       }

 <input ng-show="burs.birlestirme=='EVET'" type="checkbox" ng-change="newDsc(burs.mat_oran,checkBoxStatus[$index])" ng-model="checkBoxStatus[$index]" ng-checked="checkBoxStatus[$index]">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM