解决bootstrap-table多次请求只触发一次的问题


问题

通过设置查询条件,点击按钮触发bootstrap-table,触发以后无法再次触发

解决方案

在初始化table之前,要将table销毁,否则会保留上次加载的内容

 1 $("#table").bootstrapTable('destroy'); 
 2 $("#table").bootstrapTable({
 3   dataType: "json",
 4   method: 'get',
 5   contentType: "application/x-www-form-urlencoded",
 6   cache: false,
 7   url:url,
 8   queryParams: queryParams,
 9   columns:col,
10   pagination:true,
11   sidePagination:'server',
12   pageNumber:1,
13   pageSize:10,
14   pageList:[10, 25, 50, 100, 'All'],
15   onCheck: function (row) {
16     var id = checkid;
17     //遍历所有的row 获取name
18     //params["ids"] .add(row.agancyid);
19     params["ids"] += row[""+id+""] +",";
20   }
21 })

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM