|
|
@@ -129,32 +129,48 @@
|
|
|
that.load(data);
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+ var stateField = that.header.stateField;
|
|
|
|
|
|
if (that.options.exportDataType === 'all' && that.options.pagination) {
|
|
|
that.$el.one(that.options.sidePagination === 'server' ? 'post-body.bs.table' : 'page-change.bs.table', function () {
|
|
|
+ if (stateField){
|
|
|
+ that.hideColumn(stateField);
|
|
|
+ }
|
|
|
doExport();
|
|
|
that.togglePagination();
|
|
|
});
|
|
|
that.togglePagination();
|
|
|
} else if (that.options.exportDataType === 'selected') {
|
|
|
var data = that.getData(),
|
|
|
- selectedData = that.getAllSelections();
|
|
|
+ selectedData = that.getSelections();
|
|
|
+ if (!selectedData.length)
|
|
|
+ return;
|
|
|
|
|
|
- // 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();
|
|
|
+ var dataServer = {total: that.options.totalRows};
|
|
|
+ dataServer[that.options.dataField] = data;
|
|
|
+ data = dataServer;
|
|
|
+ var selectedDataServer = {total: selectedData.length};
|
|
|
+ selectedDataServer[that.options.dataField] = selectedData;
|
|
|
+ selectedData = selectedDataServer;
|
|
|
}
|
|
|
|
|
|
that.load(selectedData);
|
|
|
+ if (stateField){
|
|
|
+ that.hideColumn(stateField);
|
|
|
+ }
|
|
|
doExport();
|
|
|
that.load(data);
|
|
|
} else {
|
|
|
+ if (stateField){
|
|
|
+ that.hideColumn(stateField);
|
|
|
+ }
|
|
|
doExport();
|
|
|
}
|
|
|
+ if (stateField){
|
|
|
+ that.showColumn(stateField);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|