bootstrap-table刷新数据,设置分页跳转的页码;queryParams设置参数
情况一:不刷新页面,只刷新bootstrap-table时:
$('.Rectangle-Copy-submit').click(function () { //方法一 // $('#suspects-grid').bootstrapTable('selectPage', 1); // $('#suspects-grid').bootstrapTable('refresh'); //方法二 $('#suspects-grid').bootstrapTable('refresh',{ pageNumber: 1}); //方法三 var input_Source = $("#input_Source").val(); $('#uspects-grid').bootstrapTable('refreshOptions',{pageNumber: 1, queryParams: function (params) { params.source = input_Source; return params; } }); });
情况二:刷新页面时,上面的方法就不管用:
function accType(date) { setCookie('opportunitiesCI.bs.table.pageNumber',1); var url = "{:url('index')}?opp_date="+date; window.location.href=url; }
opportunitiesCI的来源
bootstrapTable中queryParams设置参数
$('#suspects-grid').bootstrapTable('refreshOptions',{pageNumber: 1, queryParams: function (params) { params.event = input_Event; params.country = input_country; params.source = input_Source; return params; } });
官网文档:https://www.bootstrap-table.com.cn/examples/methods/get-all-selections/