使用angularjs中的级联下拉列表过滤表数据

时间:2014-12-17 21:44:58

标签: angularjs

我想使用angularjs中的级联下拉列表来过滤表格。它适用于父下拉菜单,但不适合儿童下拉菜单。

这是我的控制器代码:

app.controller('myController', function ($scope, $http) {

GetSupportData();
$scope.setSelected = function () {enter code here
if ($scope.lastSelected) {
$scope.lastSelected.selected = '';
}
this.selected = 'rowSelect';
$scope.lastSelected = this;
}
$scope.predicate = '-Date';


function GetSupportData() {
blockUI();
$http({
method: 'Get',
url: '/Home/GetSupportData',
}).success(function (data, status, headers, config) {
$scope.Support = data.SupportData;


enablePinning: true;
unblockUI();
}).error(function (data, status, headers, config) {
unblockUI();
$scope.message = 'Unexpected Error';
});
 }


});

这是我的观看代码:

<tr data-ng-repeat="data in QCQA | filter: System.SYSTEM_TITLE:ignoreNullComparator | filter: Moduledata.MODULE_TITLE:ignoreNullComparator | orderBy:predicate:reverse" class="{{data.ISSUE_STATUS}} {{data.DAY_COUNT}} {{selected}}" data-ng-click="setSelected(this)" style="min-height: 25px">


<div id="StateSectionsBar" class="divStateSectionsBar" style="height: 30px">
<div>
<div class="divControlsRow">
<div class="divDesc">System:</div>
<div class="divControls">
<select data-ng-model="System.SYSTEM_TITLE"  data-ng-options="s.SYSTEM_ID as s.SYSTEM_TITLE for s        in sysList" data-ng-change="GetModule()">
 <option value="">----------------------All--------------------</option>
 </select>            
 </div>
 <div class="divDesc">Module:</div>
 <div class="divControls">

 <select  data-ng-model="Moduledata.MODULE_TITLE" data-ng-disabled="!ModuleData" data-ng-options="m.MODULE_ID as m.MODULE_TITLE for m in ModuleData">
 <option value="">----------------------All--------------------</option>
 </select>

 </div>
  </div>
  </div>
  </div>

0 个答案:

没有答案