bootstrap-table 积累

$("#table").bootstrapTable({

  toolbar:"#toolbar", //设置自定义工具栏容器ID,也可以是容器样式类名.toolbar

//buttonsPrefix: 'btn',
buttonsClass: 'primary',
//iconSize:"sm",
//contentType:"application/x-www-form-urlencoded; charset=zh-CN",
//data-method="get",
//url: 'http://127.0.0.1:82/rl/json.txt',
//dataType: "json",
locale: "zh-CN",
//uniqueId: 'id',
striped: true, //是否显示行间隔色
// height:600,

//sortable: true,//是否排序
//showRefresh:false, //是否刷新
search: true, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端
//showSearchClearButton:true, //垃圾桶
showColumns: true, //是否显示所有的列,自定义选测的列
//showToggle: false,//工具栏上显示列表模式切换
showExport: true,//工具栏上显示导出按钮

clickToSelect: true, //是否启用点击选中行

minimumCountColumns: 3, //最少允许的列数
pagination:true, //是否显示分页
pageSize: 10, //每页的记录行数
pageList: [10, 25, 50, 100,'All'], //可供选择的每页的行数(*)
//singleSelect: false,//单行选择单行,设置为true将禁止多选
//showFooter: true,
//useRowAttrFunc: true,
paginationPreText:"上一页",
paginationNextText:"下一页",
paginationLoop:false, //禁用分页循环



exportDataType:'all',
showExport: true, //是否显示导出按钮
buttonsAlign:"right", //按钮位置
exportTypes:['json', 'csv', 'txt', 'sql', 'doc', 'xlsx'], //导出文件类型
Icons:'glyphicon-export',
exportOptions: {
fileName: 'EmpgzTable<%=now()%>',
},





columns: [

{ field: 'TypeId', checkbox: true},
{ field: 'gzdat', title: '日期',footerFormatter: "Total"},
{ field: 'dptid', title: '门店编码',valign: 'middle',halign: 'center',align: 'center',sortable:true},
{ field: 'deptid', title: '门店名称',sortable:true},
{ field: 'empid', title: '员工ID',sortable:true },
{ field: 'empname', title: '姓名',sortable:true},
{ field: 'depname', title: '所属区域',valign: 'middle', halign: 'center', align: 'center',sortable:true},
{ field: 'empbiaos', title: '岗位',width: 320, align:'left',sortable:true},
{ field: 'gz_all', title: '工资',sortable:true,footerFormatter: function (value) {

var count = 0;
for (var i in value) {
if(value[i].gz_all !=null){
count += value[i].gz_all;
}
}
return count.toFixed(2);//保留两位小数
}

},

 


{ field: 'button', title: '操作',formatter: function(value,row,index) {

var a = "";
if(value == "待提交") {
a = '<span style="color:#fa9f00">'+value+'</span>';
}else if(value == "已入库"){
a = '<span style="color:#00ff00">'+value+'</span>';
}else if(value == "待修改") {
a = '<span style="color:#FF0000">'+value+'</span>';
}else if(value == "待审批") {
a = '<span style="color:#fa9f00">'+value+'</span>';
}else{
a = '<span style="color:#0000ff">'+value+'</span>';

}

return a;

},

 

},],

data:<%=JsStr%>

})

 

posted @   茶叶蛋蛋  阅读(92)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示