Skip to content

Commit aa9b779

Browse files
author
Denny Mueller
committed
fix(exporter): pass column seperator options as param to downloadFile
1 parent cbeae2c commit aa9b779

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/features/exporter/js/exporter.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@
626626
var exportData = self.getData(grid, rowTypes, colTypes);
627627
var csvContent = self.formatAsCsv(exportColumnHeaders, exportData, grid.options.exporterCsvColumnSeparator);
628628

629-
self.downloadFile (grid.options.exporterCsvFilename, csvContent, grid.options.exporterOlderExcelCompatibility);
629+
self.downloadFile (grid.options.exporterCsvFilename, csvContent, grid.options.exporterCsvColumnSeparator, grid.options.exporterOlderExcelCompatibility);
630630
});
631631
},
632632

@@ -909,7 +909,7 @@
909909
* download as a file
910910
* @param {boolean} exporterOlderExcelCompatibility whether or not we put a utf-16 BOM on the from (\uFEFF)
911911
*/
912-
downloadFile: function (fileName, csvContent, exporterOlderExcelCompatibility) {
912+
downloadFile: function (fileName, csvContent, columnSeparator, exporterOlderExcelCompatibility) {
913913
var D = document;
914914
var a = D.createElement('a');
915915
var strMimeType = 'application/octet-stream;charset=utf-8';
@@ -921,8 +921,8 @@
921921
var frame = D.createElement('iframe');
922922
document.body.appendChild(frame);
923923

924-
frame.contentWindow.document.open("text/html", "replace");
925-
frame.contentWindow.document.write('sep=,\r\n' + csvContent);
924+
frame.contentWindow.document.open('text/html', 'replace');
925+
frame.contentWindow.document.write('sep=,' + columnSeparator + '\r\n' + csvContent);
926926
frame.contentWindow.document.close();
927927
frame.contentWindow.focus();
928928
frame.contentWindow.document.execCommand('SaveAs', true, fileName);

0 commit comments

Comments
 (0)