或者是,我使用的bootstrap table ,如何默认加载所有页数据,而不是只加载一页?

解决方案 »

  1.   

    将tableExport.js文件中的filter(':visible') 过滤器去掉就可以了
      

  2.   

    在 bootstrap-table-export.js中修改exportDataType属性为all就可以了。
      

  3.   

    设置成“all” 也不行,还是只能导出当前页,并且只能导出20条记录
      

  4.   

    在dataTable中使用下面的配置即可"aLengthMenu": [[10, 25, 50, 100, -1], ["10条", "25条", "50条", "100条", "所有数据"]]  //设置每页显示记录的下拉菜单
      

  5.   

    求助啊,遇到同样的问题,还请大神解救。在bootstrap table官网看导出的扩展功能,就跑到tableexport插件,他跟bootstraptable什么关系,tableexport插件怎么导出分页的所有数据
      

  6.   

    在 bootstrapTable修改        showExport : true, //是否显示导出按钮
    exportDataType : "selected", //basic'导出当前页, 'all'导出全部, 'selected'导出选中项.
      

  7.   

    请问大神们怎么解决的,我也只能导出第一页,而且设置了all好像没什么用
      

  8.   

    用这个插件是不能导出所有数据的,需要后端做,你只需提供<a download>导出</a>即可
      

  9.   

    打开源文件 , ForEachVisibleCell方法改成这样:function ForEachVisibleCell(tableRow, selector, rowIndex, cellcallback) {
                    if (defaults.ignoreRow.indexOf(rowIndex) == -1) {
                        $(tableRow).find(selector).each(function (colIndex) {
                                if (defaults.ignoreColumn.indexOf(colIndex) == -1) {
                                    if (typeof (cellcallback) === "function") {
                                        var cs = 0; // colspan value                                    // handle previously detected rowspans
                                        if (typeof rowspans[rowIndex] != 'undefined' && rowspans[rowIndex].length > 0) {
                                            for (c = 0; c <= colIndex; c++) {
                                                if (typeof rowspans[rowIndex][c] != 'undefined') {
                                                    cellcallback(null, rowIndex, c);
                                                    delete rowspans[rowIndex][c];
                                                    colIndex++;
                                                }
                                            }
                                        }                                    // output content of current cell
                                        cellcallback(this, rowIndex, colIndex);                                    // handle colspan of current cell
                                        if ($(this).is("[colspan]")) {
                                            cs = $(this).attr('colspan');
                                            for (c = 0; c < cs - 1; c++)
                                                cellcallback(null, rowIndex, colIndex + c);
                                        }                                    // store rowspan for following rows
                                        if ($(this).is("[rowspan]")) {
                                            var rs = parseInt($(this).attr('rowspan'));                                        for (r = 1; r < rs; r++) {
                                                if (typeof rowspans[rowIndex + r] == 'undefined')
                                                    rowspans[rowIndex + r] = [];
                                                rowspans[rowIndex + r][colIndex] = "";                                            for (c = 1; c < cs; c++)
                                                    rowspans[rowIndex + r][colIndex + c] = "";
                                            }
                                        }
                                    }
                                }
                            
                        });
                    }
                }
      

  10.   

    页面可以增加一个(行数pageSize)手动输入,想导出多少行就输入多少行
      

  11.   

    楼主好,这个问题怎么解决啊,上面几种方法都试过了,没这个filter(':visible') 过滤器啊,ForEachVisibleCell换了也不行啊,求教
      

  12.   

    我是java,但是我们依然要考虑整个系统的加载速度和网页的加载速度,你们前端不考虑这些,编程应该注重几个原则,其中用户体验度是占比很大的,同志们
      

  13.   

    到官网下载bootstrap table 压缩包和tableExport.js。页面引用以下文件bootstrap-table.cssbootstrap-table.jstableExport.jsbootstrap-table-export.js表格属性加入$('#table').bootstrapTable({showExport: true,exportDataType:"all"})
      

  14.   

    导出所有数据的话,不建议在前台去做,因为首先加载所有数据就很慢,还要占用线程资源去导出,那么整个页面就会僵死。建议后台去做导出操作,可以使用这个方法:https://blog.csdn.net/tianjiliuhen/article/details/83177928