創建用戶defind搜索輸入
div class="container" style="padding-left: 0px;">
<form>
<div class="form-group" style="margin-bottom: 0px;">
<div class="input-group" style=" margin-left: 15px;">
<div class="input-group-addon" style=" padding-left: 15px;"><span> Filter </span></div>
<input type="text" class="form-control" placeholder="Type here..." ng-model="searchFish" style="width: 92%;">
</div>
</div>
</form>
</div>
短記錄
<table class="table table-bordered table-striped" id="myTable" style=" width: 99%;max-width: 93%; text-align: center;" >
<thead>
<tr>
<th style="border: 0px solid #ddd;" class="textbgcolor textcenter"> user id # <img src="img/up.svg" style="width: 13px;" ng-click="orderProperty = 'user_id'"/> </th>
</tr>
</thead>
<tbody>
<tr ng-repeat="t in current_table | orderBy:orderProperty | orderBy:use_id | filter:searchFish ">
<td style=" border: 0px solid #ddd;"> {{t.use_id}} </td>
</tr>
</tbody>
</table>
是funcation直接使用
//========================================================== asssending and discending oreder funcation
$scope.setOrderProperty = function(propertyName) {
if ($scope.orderProperty === propertyName) {
$scope.orderProperty = '-' + propertyName;
} else if ($scope.orderProperty === '-' + propertyName) {
$scope.orderProperty = propertyName;
} else {
$scope.orderProperty = propertyName;
}
}
// -=====================================================
$scope.sortType = 'x.user_id' // set the default sort type
$scope.sortReverse = false; // set the default sort order
$scope.searchFish = ''; // set the default search/filter term