Skip to content

Commit

Permalink
fix(exporter): pass column seperator options as param to downloadFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Denny Mueller committed Feb 17, 2016
1 parent cbeae2c commit aa9b779
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/features/exporter/js/exporter.js
Expand Up @@ -626,7 +626,7 @@
var exportData = self.getData(grid, rowTypes, colTypes);
var csvContent = self.formatAsCsv(exportColumnHeaders, exportData, grid.options.exporterCsvColumnSeparator);

self.downloadFile (grid.options.exporterCsvFilename, csvContent, grid.options.exporterOlderExcelCompatibility);
self.downloadFile (grid.options.exporterCsvFilename, csvContent, grid.options.exporterCsvColumnSeparator, grid.options.exporterOlderExcelCompatibility);
});
},

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

frame.contentWindow.document.open("text/html", "replace");
frame.contentWindow.document.write('sep=,\r\n' + csvContent);
frame.contentWindow.document.open('text/html', 'replace');
frame.contentWindow.document.write('sep=,' + columnSeparator + '\r\n' + csvContent);
frame.contentWindow.document.close();
frame.contentWindow.focus();
frame.contentWindow.document.execCommand('SaveAs', true, fileName);
Expand Down

0 comments on commit aa9b779

Please sign in to comment.