AngularJS实现模糊过滤查询

<form class="form-horizontal">
        <div class="form-bottom col-xs-6">
          <span class="font-weight">EID</span>
          <div class="input-div">
            <input type="text" placeholder="EID" ng-model="eid" class="demo-input" ng-keyup="searchRecords($event)">   
          </div>
          <button class="btn btn-primary" ng-click="searchEID()">Query</button>
        </div>
        <div class="form-bottom col-xs-6">
            <!-- <span>Contry</span>
            <div class="input-div">
              <input type="text" placeholder="Please select the month" class="demo-input input_field_madoka"> 
              
            </div> -->
          </div>
      </form>
      <table class="table table-striped">
        <thead>
          <tr>
            <th>Contry</th>
            <th>City</th>
            <th>Department</th>
            <th>EID</th>
            <th>Start Time</th>
            <th>Session Length</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="record in record.historyRcords | filter:eid" ng-click="openDetail(record.id)">
            <td>{{record.Country}}</td>
            <td>{{record.Location}}</td>
            <td>{{record.Entity}}</td>
            <td>{{record.eid}}</td>
            <td>{{record.last_date}}</td>
            <td>{{record.datelen}}s</td>
          </tr>
        </tbody>
      </table>
      <tm-pagination conf="paginationRcords"></tm-pagination>

  输入框的ng-model和filter匹配即可(不会对数据库进行查询,只会针对页面显示数据进行搜索)

猜你喜欢

转载自www.cnblogs.com/bertha-zm/p/8926841.html
今日推荐