JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-chosen-localytics/1.5.0/angular-chosen.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.6.2/chosen.jquery.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.6.2/chosen.css">
<html ng-app="demoApp">
<div ng-controller="mainController">
<table width="100%" id="userTable">
<tr id="formattyperow">
<td class="label-cell">* Report Format :</td>
<td>
<select name="exporType" id="exporType"
ng-model="exporType"
ng-options="format.value as format.name for format in formatOptions"
ng-change="checkDisable()" style="width:145px;">
</select>
</td>
</tr>
<tr>
<td class="label-cell">* Mask Account Numbers :</td>
<td>
<select name="maskAccountNumber" id="maskAccountNumber"
ng-model="maskAccountNumber"
ng-options="mask.value as mask.name disable when mask.disabled for mask in maskOptions"
ng-change="checkDisable()" style="width:145px;">
</select>
</td>
</tr>
</table>
</div>
</html>
JavaScript
angular.module('demoApp', ['localytics.directives'])
.filter('maskAccountFilter',function () {
return function (defaultmaskobject,selectedFormat) {
var i, newObject = [];
for(i=0;i < defaultmaskobject.length;i++)
{
var obj = defaultmaskobject[i];
if(obj["yesNoName"] == "No")
newObject.push(obj);
if(obj["yesNoName"] == "Yes")
{
if(selectedFormat == "XLS" || selectedFormat == "PDF")
newObject.push(obj);
}
}
return newObject;
};
})
.controller('mainController', MainController);
function MainController($scope) {
$scope.disableoption = true;
$scope.formatOptions = [{value: "BAI", name: "BAI"},
{value: "CSV", name: "CSV"},
{value: "PDF", name: "PDF"},
{value: "QBO", name: "QBO"},
{value: "QFX", name: "QFX"},
{value: "XLS", name: "XLS"}];
$scope.maskOptions = [{value: "N", name: "No", disabled: false},
{value: "Y", name: "Yes", disabled: true}];
$scope.exporType = "BAI";
$scope.maskAccountNumber = "N";
$scope.checkDisable = function() {
if ($scope.exporType == "PDF") {
$scope.maskOptions[1].disabled = false;
}
else {
$scope.maskOptions[1].disabled = true;
$scope.maskAccountNumber = "N";
}
};
};