doExport = function doExport(callback) {
          if (stateField) {
            _this2.hideColumn(stateField);
          }
          if (isCardView) {
            _this2.toggleView();
          }
          _this2.columns.forEach(function (row) {
            if (row.forceHide) {
              _this2.hideColumn(row.field);
            }
          });
          var data = _this2.getData();
          if (o.detailView && o.detailViewIcon) {
            var detailViewIndex = o.detailViewAlign === 'left' ? 0 : _this2.getVisibleFields().length + Utils.getDetailViewIndexOffset(_this2.options);
            o.exportOptions.ignoreColumn = [detailViewIndex].concat(o.exportOptions.ignoreColumn || []);
          }
          if (o.exportFooter && o.height) {
            var $footerRow = _this2.$tableFooter.find('tr').first();
            var footerData = {};
            var footerHtml = [];
            $footerRow.children().forEach(function (footerCell, index) {
              var footerCellHtml = $(footerCell).children('.th-inner').first().html();
              footerData[_this2.columns[index].field] = footerCellHtml === '&nbsp;' ? null : footerCellHtml;

              // grab footer cell text into cell index-based array
              footerHtml.push(footerCellHtml);
            });
            _this2.$body.append(_this2.$body.children().last()[0].outerHTML);
            var $lastTableRow = _this2.$body.children().last();
            $lastTableRow.children().forEach(function (lastTableRowCell, index) {
              $(lastTableRowCell).html(footerHtml[index]);
            });
          }
          var hiddenColumns = _this2.getHiddenColumns();
          hiddenColumns.forEach(function (row) {
            if (row.forceExport) {
              _this2.showColumn(row.field);
            }
          });
          if (typeof o.exportOptions.fileName === 'function') {
            options.fileName = o.exportOptions.fileName();
          }
          _this2.$el.tableExport(Utils.extend({
            onAfterSaveToFile: function onAfterSaveToFile() {
              if (o.exportFooter) {
                _this2.load(data);
              }
              if (stateField) {
                _this2.showColumn(stateField);
              }
              if (isCardView) {
                _this2.toggleView();
              }
              hiddenColumns.forEach(function (row) {
                if (row.forceExport) {
                  _this2.hideColumn(row.field);
                }
              });
              _this2.columns.forEach(function (row) {
                if (row.forceHide) {
                  _this2.showColumn(row.field);
                }
              });
              if (callback) callback();
            }
          }, o.exportOptions, options));
        }
@author zhixin wen <wenzhixin2010@gmail.com>
extensions: https://github.com/hhurz/tableExport.jquery.plugin