Browse Source

Update bootstrap-table-export.js

resolve export when data is loaded from server, see issue #1270
Razvan 10 years ago
parent
commit
f011be3011
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/extensions/export/bootstrap-table-export.js

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

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