Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

Pass data from JSON #198

Open
centurianii opened this issue Mar 28, 2020 · 0 comments
Open

Pass data from JSON #198

centurianii opened this issue Mar 28, 2020 · 0 comments

Comments

@centurianii
Copy link

centurianii commented Mar 28, 2020

I want to pass data dynamically constructed from array like in these 2 situations:

var data = [
   {field1: "...", field2: "...", ...},
   ...
]
  1. or
var data = {
   fields: ["field1", "field2", ...],
   records: [
      ["...", "...", ...],   // follows the order of fields
      ...
   ]
  1. or
   var fields = ["field1", "field2", ...];
   var records = [
      ["...", "...", ...],   // follows the order of fields
      ...
   ];

Describe the solution you'd like
Ideally I prefer the 2nd/3rd constructs so that one can call

/////NEW FEATURE//////
var table = TableExport(fields, records);
// or
table = TableExport({fields: fields, records: records}); 
//////ALREADY APPLIES////////
/* convert export data to a file for download */
var exportData = table.getExportData(); 
var xlsxData = exportData.table.xlsx; // Replace with the kind of file you want from the exportData
table.export2file(xlsxData.data, xlsxData.mimeType, xlsxData.filename, xlsxData.fileExtension, xlsxData.merges, xlsxData.RTL, xlsxData.sheetname)

Describe alternatives you've considered
Hack the code!

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant