智能表分页链接不工作
Smart Table Pagination links not working
我有下面的HTML:
<table st-table="displayedCollection"
st-safe-src="rowCollection"
class="table table-striped"
st-pipe="callServer">
<thead>
<tr>
<th st-sort="id">id</th>
<th st-sort="name">name</th>
</tr>
</thead>
<tbody ng-show="!isLoading">
<tr ng-repeat="row in displayedCollection">
<td>{{row.id}}</td>
<td>{{row.name}}</td>
</tr>
</tbody>
<tbody ng-show="isLoading">
<tr>
<td colspan="2" class="text-center">Loading ... </td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center" colspan="2">
<div
st-template="templates/plugins/pagination.html"
st-pagination=""
st-items-by-page="10"
class="ng-isolate-scope">
</div>
</td>
</tr>
</tfoot>
</table>
我在控制器中有以下代码:
$scope.callServer = function callServer(tableState) {
var pagination = tableState.pagination;
var start = pagination.start || 0;
var size = pagination.number || 10;
console.log('tableState:', tableState);
$scope.isLoading = true;
TestSuiteService.getPage(start, size, tableState).then(function (response) {
$scope.rowCollection = response.results;
$scope.displayedCollection = [].concat($scope.rowCollection);
tableState.pagination.numberOfPages = response.numberOfPages;
$scope.isLoading = false;
});
};
我有以下st-template
<div class="pagination" ng-if="pages.length >= 2">
<ul class="pagination">
<li ng-if="currentPage > 1">
<a ng-click="selectPage(1)"><<</a>
</li>
<li ng-if="currentPage > 1">
<a ng-click="selectPage(currentPage-1)"><</a>
</li>
<li ng-repeat="page in pages" ng-class="{active: page==currentPage}">
<a ng-click="selectPage(page)">{{page}}</a>
</li>
<li ng-if="currentPage < numPages">
<a ng-click="selectPage(currentPage+1)">></a>
</li>
<li ng-if="currentPage < numPages">
<a ng-click="selectPage(numPages)">>></a>
</li>
</ul>
</div>
当我点击页面时,它会从服务器获取数据并将其显示在表中,但页面并没有被选中。由于此原因,上一页和最后一页的链接也不会显示。页面1始终保持活动状态。
我已经从table
中删除了st-safe-src
属性,所以在我的情况下,我必须删除st-safe-src="rowCollection"
才能使其工作。
相关文章:
- 通过链接重定向不;我不在jstree中工作
- JavaScript链接在点击时不起作用;函数在页面加载时工作
- 谷歌公共日历链接没有'不工作(完整日历)
- HTML5 Shiv谷歌CDN链接不工作
- 链接don'由于Javascript悬停效果,无法在移动设备上工作
- 我如何使这个YouTube链接在iOS上工作
- 链接悬停css在不浮动时不在表浮动标题中工作
- 绝对链接/相对链接均未获胜't在菜单中工作
- "此网站似乎使用滚动链接定位效果.这可能不能很好地与异步平移一起工作;
- 谷歌jQuery UI链接无法脱机工作
- 谷歌分析跟踪内部链接不正常工作的事件
- 当我添加JavaScript时,链接按钮停止工作
- ajax代码工作时,使用javascript禁用html中的链接
- Jquery/CS3转换链接只能部分工作
- 禁用触摸设备上的单击链接未按预期工作
- 对链接的 svg 进行动画处理不起作用;内联时工作正常
- IJava脚本无法正常工作/链接正常
- 为什么这个下拉菜单没有填充工作链接
- SimpleCart.js项链接未定义,可以'I don’我无法获得工作链接
- 如果一个javascript函数被分配给一个工作链接,该函数会首先执行吗