zoukankan      html  css  js  c++  java
  • 使用tableExport导出bootstrap-table表格 支持中文的Excel等格式

    $('#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', 'txt', 'sql', 'doc', 'excel', 'xlsx', 'pdf'
            exportOptions:{
                // ignoreColumn: [0,1],  //忽略某一列的索引
                fileName: questionNaireName,  //文件名称设置
                worksheetName: 'sheet1',  //表格工作区名称
                tableName: questionNaireName,
                // excelstyles: ['background-color', 'color', 'font-size', 'font-weight'], 设置格式
            },
     
     
     
        });
    

      

  • 相关阅读:
    Android Studio [Toast]
    Android Studio [RecyclerView/瀑布流显示]
    Android Studio [RecyclerView/列表视图]
    NABCD分析 [团队任务]
    Android Studio [ListView]
    Android Studio [ImageView/使用第三方库加载图片]
    Android Studio [真机测试/开发者模式]
    Android Studio [登陆界面]
    android开发笔记
    gzframework开发记录
  • 原文地址:https://www.cnblogs.com/tengrl/p/11040427.html
Copyright © 2011-2022 走看看