Improve export to CSV functionality

- added`callback`option so we can get CSV data in case we do not want
to download
 - added options:
    - `quoted` for cases when we have line breaks in content
    - `separator` for cases when we have commas in content
This commit is contained in:
Sergio Crisostomo 2017-10-17 10:13:54 +02:00
parent 109465d3c5
commit fb8479988c
2 changed files with 32 additions and 27 deletions

View file

@ -714,8 +714,9 @@
let noHeader = false;
if ('noHeader' in params) noHeader = params.noHeader;
const data = Csv(columns, datas, ',', noHeader);
ExportCsv.download(params.filename, data);
const data = Csv(columns, datas, params, noHeader);
if (params.callback) params.callback(data);
else ExportCsv.download(params.filename, data);
}
},
created () {