[CSV Export] Begin testing exportService

...including fixes to immediately-identified errors.
This commit is contained in:
Victor Woeltjen
2016-02-05 13:32:21 -08:00
parent 750a5648d2
commit 8868b6a130
3 changed files with 63 additions and 2 deletions

View File

@@ -29,10 +29,10 @@ define(['csv'], function (CSV) {
ExportService.prototype.exportCSV = function (rows, options) {
var headers = (options && options.headers) ||
(Object.keys((rows[0] || {}).sort())),
(Object.keys((rows[0] || {})).sort()),
filename = (options && options.filename) || "export.csv",
csvText = new CSV(rows, { header: headers }).encode(),
blob = new Blob(csvText, { type: "text/csv" });
blob = new Blob([ csvText ] , { type: "text/csv" });
this.saveAs(blob, filename);
};