本文摘自PHP中文网,作者青灯夜游,侵删。
本篇文章给大家介绍一下bootstrapTable刷新(重新加载数据)的3种方式。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。
【相关推荐:《bootstrap教程》】
项目中使用到了bootstrapTable , 根据条件查询数据,重新加载列表,有几种方式。
直接看代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | $( function () {
load();
});
function load() {
$( '#dataTable' ).bootstrapTable(
{
method : 'post' ,
url : "/user/list" ,
pageSize : 10,
pageNumber : 1,
sidePagination : "server" ,
queryParams : function (params) {
return {
limit: params.limit,
offset: params.offset,
userName: $.trim( $( '#userName' ).val() ) ,
age: $.trim( $( '#age' ).val() ) ,
}
},
columns : [
{
checkbox : true
},
{
field : 'userName' ,
title : '名称' ,
},
{
field : 'age' ,
title : '年龄' ,
},
{
field : 'createDate' ,
title : '创建时间' ,
},
{
title : '操作' ,
field : 'id' ,
formatter : function (value, row, index) {
return '' ;
}
}
]
});
}
function reLoad() {
$( '#dataTable' ).bootstrapTable( 'destroy' );
load();
}
function reLoad2() {
$( "#dataTable" ).bootstrapTable( 'refreshOptions' ,{pageNumber:1});
$( "#dataTable" ).bootstrapTable( 'refresh' );
}
function reLoad3() {
$( "#dataTable" ).bootstrapTable( 'selectPage' , 1);
}
|
说明:
阅读剩余部分
相关阅读 >>
bootstraptable排序可以么
web端的应用实现后退强制刷新
浅谈bootstraptable+jstree插件对树列表条件和查询条件的处理
bootstraptable 隐藏列的方法
h5的localstorage如何在本地存储刷新值
bootstraptable如何重新加载数据?3种方式了解一下!
layui批量删除怎么刷新当前分页
更多相关阅读请进入《bootstraptable》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » bootstrapTable如何重新加载数据?3种方式了解一下!