浏览代码

fix(export extension): fix #2220, selected rows does not work when data-pagination-side is server

Sam Peka 9 年之前
父节点
当前提交
40e2ce0d51
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/extensions/export/bootstrap-table-export.js

+ 9 - 0
src/extensions/export/bootstrap-table-export.js

@@ -108,6 +108,15 @@
                         var data = that.getData(),
                             selectedData = that.getAllSelections();
 
+                        // Quick fix #2220
+                        if (that.options.sidePagination === 'server') {
+                            data = {total: that.options.totalRows};
+                            data[that.options.dataField] = that.getData();
+
+                            selectedData = {total: that.options.totalRows};
+                            selectedData[that.options.dataField] = that.getAllSelections();
+                        }
+
                         that.load(selectedData);
                         doExport();
                         that.load(data);