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 @ 2021-08-04 09:52  茶叶蛋蛋  阅读(101)  评论(0)    收藏  举报