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

Pass data from JSON #198

@centurianii

Description

@centurianii

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions