Reputation: 344
I have a table with editable columns. I'd like to let the users import data to massively update the table at once.
As tabulator can't use the import in update mode, I instantiate a 2nd tabulator and call import on that one (the idea being to do : importtab.getData()
=> some processing => realtab.updateData()
)
Anyway : if I call tabulatorImport.import('xlsx', '.xlsx', 'buffer')
, I get to choose a file, and then the Tabulator displays "Loading" while this error appears in the console. Note that I'm using a file that was exported from the same tabulator (tabulatorImport.download('xlsx', 'foobar.xlsx')
) without any modification to it yet.
> ERROR TypeError: t.replace is not a function
> at Object.r [as decode] (node_modules\xlsx\dist\xlsx.full.min.js:10:27204)
> at Fg (node_modules\xlsx\dist\xlsx.full.min.js:23:11690)
> at Wg (node_modules\xlsx\dist\xlsx.full.min.js:23:13623)
> at Object.Wg [as read] (node_modules\xlsx\dist\xlsx.full.min.js:23:13002)
> at TabulatorFull.xlsx (tabulator_esm.mjs:13463:22)
> at tabulator_esm.mjs:13623:21
If I call tabulatorImport.import('csv', '.csv'), it work well, and I can log a getData() to check it. With 1 minor and 1 major inconveniences : (1) I'll need to write import mutators to revert the work done by formatters and download accessors (2) the csv wants comma "," whereas my users will save them from excel and obtain semicolons ";" (not to mention all csv imports in the app are expecting semicolons). And tbh, I'd really prefer XLSX over CSV, as this functionality will have best UX if people can re-import the exported excel file.
Upvotes: 0
Views: 25
Reputation: 344
After updating Tabulator's npm package, you also need to update xlsx manually. Versions that work together :
"tabulator-tables": "^6.3.1",
"xlsx": "^0.18.5",
Upvotes: 0