2017-03-17 64 views
0

我是新的角度。我通過查看其文檔第一次嘗試了智能表。我在搜索和分頁時遇到問題。我試圖尋找堆棧溢出的各種解決方案,但沒有成功。請幫助角度智能表格搜索和分頁不起作用

<table st-table="displayedCollection" st-safe-src="rowList" class="table table-stripped"> 
<thead> 
    <tr> 
     <th st-sort="engagement_id">Engagement Id</th> 
     <th st-sort="customer_name">Customer Name</th> 
    </tr> 
    <tr> 
     <th colspan="8"> 
      <input st-search placeholder="global search" class="input-sm form-control" type="search" /> 
     </th> 
    </tr> 
</thead> 
<tbody> 
    <tr ng-repeat="data in displayedCollection"> 
     <td>{{data.engagement_id}}</td> 
     <td>{{data.customer_name}}</td> 
    </tr> 
</tbody> 
<tfoot> 
    <tr> 
     <td colspan="5" class="text-center"> 
      <div st-pagination="" st-items-by-page="5" colspan="8"></div> 
     </td> 
    </tr> 
</tfoot> 

這裏是使用智能表CDN 這裏的角碼

$.post(MY_CONSTANT.url + '/all_rides', { 
     access_token: $cookieStore.get('obj').accesstoken, 
     start_limit: start_limit, 
     end_limit: end_limit 

    }, function (data) { 
     $scope.showloader=false; 

     if (data.status == true) { 
      var rides = data.data[1]; 
      $scope.rowList = rides; 
      $scope.displayedCollection = [].concat($scope.rowList); 
     } 
     else if (data.status == responseCode.INVALID_ACCESS_TOKEN){ 
      $state.go('page.login'); 
     } 
    }); 

鏈接:https://cdnjs.cloudflare.com/ajax/libs/angular-smart -table/2.1.8/smart-table.min.js「>

+0

實際問題是什麼? – PaulNUK

回答

0

如果您可以從您的服務器獲取'rowList',您的發佈代碼似乎沒有問題

因此,請檢查您是否可以添加智能表庫。

angular.module('appName', ['smart-table']) 
+0

謝謝。有用 –