随便说一说bootstrap-table插件

如题、、、

 

bootstrap-table插件是一个js的表格插件

 

找了一下资料发现并没有多少

 

这里放一下初始化的语法

 

这里在html中写一个目标table元素

1 <table id="reportTable">
2         </table>

 

 1 $('#reportTable').bootstrapTable({
 2   method: 'post',
 3   url: '/qStock/AjaxPage',
 4   dataType: "json",
 5   striped: true,     //使表格带有条纹
 6   pagination: true,    //在表格底部显示分页工具栏
 7   pageSize: 22,
 8   pageNumber: 1,
 9   pageList: [10, 20, 50, 100, 200, 500],
10   idField: "ProductId",  //标识哪个字段为id主键
11   showToggle: false,   //名片格式
12   cardView: false,//设置为True时显示名片(card)布局
13   showColumns: true, //显示隐藏列  
14   showRefresh: true,  //显示刷新按钮
15   singleSelect: true,//复选框只能选择一条记录
16   search: false,//是否显示右上角的搜索框
17   clickToSelect: true,//点击行即可选中单选/复选框
18   sidePagination: "server",//表格分页的位置
19   queryParams: queryParams, //参数
20   queryParamsType: "limit", //参数格式,发送标准的RESTFul类型的参数请求
21   toolbar: "#toolbar", //设置工具栏的Id或者class
22   columns: column, //
23   silent: true,  //刷新事件必须设置
24   formatLoadingMessage: function () {
25     return "请稍等,正在加载中...";
26   },
27   formatNoMatches: function () {  //没有匹配的结果
28     return '无符合条件的记录';
29   },
30   onLoadError: function (data) {
31     $('#reportTable').bootstrapTable('removeAll');
32   },
33   onClickRow: function (row) {
34     window.location.href = "/qStock/qProInfo/" + row.ProductId;
35   },
36 });

 

嗯、、暂时用了这么多

posted @ 2016-06-24 16:34  吾之初心,永世不忘  阅读(1115)  评论(0编辑  收藏  举报