Closed xwLyc closed 7 years ago
我已经解决了,我是在查询的时候,把页码的那段html清空即可 。然后在查询重新生成页数。 比如我的例子是这样:
$('#search').on('click',function(){
$(".pageBox").html('<ul id="pagination" class="pagination "></ul>');
cityList(1); //这个是ajax 函数 ,实现页码的
return false;
});
@xwLyc 怎么在方法外面获得当前的页码,比如我在点击下一页的时候,需要把当前的页码传到后台,怎么获取当前选中的页码?
Possibly, out of date. Closed
你这个根本不是官方方法……最好还是用官方的渲染方法: var pagination = $('.label_pagination').data('twbsPagination'); if(pagination){ // 当总页数跟配置中的页数不相同时重新渲染下分页组件就行了 if(pagination.options.totalPages !== total){ pagination.options.totalPages = total; $('.label_pagination').twbsPagination('destroy'); } }
同问,每次查询条件变了,页面总数也应该变了,但前台改变不了?