浏览代码

Update bootstrap-table-export.js for bug fix

Fixed bug #1482
> Unable export data correctly first time with pagination: true and exportDataType: "all", and the data is not at server side
RJ Hsiao 10 年之前
父节点
当前提交
3c1b467033
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/extensions/export/bootstrap-table-export.js

+ 2 - 3
src/extensions/export/bootstrap-table-export.js

@@ -83,12 +83,11 @@
                         };
 
                     if (that.options.exportDataType === 'all' && that.options.pagination) {
-                        that.togglePagination();
-                        that.$el.on('load-success.bs.table', function () {
+                        that.$el.one('load-success.bs.table page-change.bs.table', function () {
                             doExport();
-                            that.$el.off('load-success.bs.table');
                             that.togglePagination();
                         });
+                        that.togglePagination();
                     } else if (that.options.exportDataType === 'selected') {
                         var data = that.getData(),
                             selectedData = that.getAllSelections();