天天看點

bootstrap table分頁時,在其他頁面無法查詢到資料

問題描述:
           

使用bootstrap table時遇到一個小問題,第一次查詢資料未5頁,翻頁到第5頁後,選中條件再次查詢資料時,傳到後端頁碼仍舊為5,而此時資料量小于5頁,表格顯示為未查詢到資料。

處理方式:

  使用bootstrap table的參數重新整理方法(refreshOptions),在查詢按鈕重新整理table發出資料請求時,将頁碼重新整理回到1。

$('#tableName').bootstrapTable('refreshOptions',{pageNumber:1});
           

本文來自 小小初行者 的CSDN 部落格 ,全文位址請點選:https://blog.csdn.net/a312024054/article/details/72677907?utm_source=copy

// 查詢  
		$("#search_btn").click(function() {
			table.bootstrapTable('refreshOptions',{pageNumber:1});
		});
           

繼續閱讀