当我输入搜索文字时,它会显示一个空白表格。
搜索文本框:
<td>
<input class="form-control" ng-model="searchName" placeholder="Search Name" type="search" ng-change="search()" style="height:5px; width:150px" />
</td>
表中显示的记录如下:
<tr class="rgRow" ng-repeat="x in addressCollection | orderBy:columnToOrder:reverse | filter: filterUser(searchName, searchTitle, searchRole, searchLOB, searchLOC)">
<td>
<radio-button ng-show="hide" name="BulletinAddressClickedIndex" level="1" model="BulletinAddressClickedIndex" value="{{x.ContactID}}" ng-click="AddressSelected()"></radio-button>
</td>
<td ng-controller="ContactCard">
<a class="set-Cursor" ng-click="OpenContactCard(x)">{{ x.FirstName }} {{x.LastName}}</a>
<a class="set-Cursor" ng-click="OpenContactCard(x)" ng-if="x.FirstName == null && x.LastName == null">{{x.CompanyName}}</a>
</td>
<td>{{ x.Title }}</td>
<td>{{ x.ContactRolesiDTO.RoleValue }}</td>
<td>
<div ng-repeat="xx in x.ContactLOBsiDTO">
{{xx.Value}}
</div>
</td>
<td>{{ x.ContactSpecificDivLoc }}</td>
</tr>
控制器中的过滤器逻辑如下:
$scope.filterUser = function(fullName, title, role, lob, loc) {
return function(addressCollection) {
return (fullName == undefined || fullName.length == 0 || addressCollection.name == fullName)
&& (title == undefined || addressCollection.title == Title)
&& (role == undefined || addressCollection.role == Role)
&& (lob == undefined || addressCollection.lob == ContactLOBsiDTO)
&& (loc == undefined || addressCollection.loc == ContactSpecificDivLoc);
}
}