使用tableExport导出bootstrap-table表格 支持中文的Excel等格式
发布时间:2020-12-17 21:29:23 所属栏目:安全 来源:网络整理
导读:$(‘#table‘).bootstrapTable(‘destroy‘).bootstrapTable({ method: ‘post‘,dataType: ‘json‘,height: 560,toolbar: ‘#toolbar‘,//工具按钮用哪个容器 pagination: true,//是否显示分页(*) maintainSelected: true,//设置为 true 在点击分页按钮
$(‘#table‘).bootstrapTable(‘destroy‘).bootstrapTable({ method: ‘post‘,dataType: ‘json‘,height: 560,toolbar: ‘#toolbar‘,//工具按钮用哪个容器 pagination: true,//是否显示分页(*) maintainSelected: true,//设置为 true 在点击分页按钮或搜索按钮时,将记住checkbox的选择项 sidePagination: "client",//分页方式:client客户端分页,server服务端分页(*) pageNumber: 1,//初始化加载第一页,默认第一页 pageSize: 10,//每页的记录行数(*) pageList: [10,25,50,100],//可供选择的每页的行数(*) search: true,//是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大 strictSearch: false,//设置为 true启用 全匹配搜索,否则为模糊搜索 showRefresh: true,//是否显示刷新按钮 minimumCountColumns: 2,//最少允许的列数 clickToSelect: true,//是否启用点击选中行 sortStable: true,showExport: true,//是否显示导出按钮 buttonsAlign:"right",//按钮位置 exportDataType: ‘all‘,//导出的方式 all全部 selected已选择的 basic‘,‘all‘,‘selected‘. Icons:‘glyphicon glyphicon-export‘,//导出图标 exportTypes:[ ‘excel‘,‘doc‘,‘xlsx‘,‘csv‘,‘txt‘,‘sql‘ ],//导出文件类型 ‘csv‘,‘sql‘,‘excel‘,‘pdf‘ exportOptions:{ // ignoreColumn: [0,1],//忽略某一列的索引 fileName: questionNaireName,//文件名称设置 worksheetName: ‘sheet1‘,//表格工作区名称 tableName: questionNaireName,// excelstyles: [‘background-color‘,‘color‘,‘font-size‘,‘font-weight‘],设置格式 },}); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |