Excel File keep loaded in background? #573
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#573
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is there a way to load the file once and use it without reloading every time I need to retrieve something?
You can always store the workbook in a global variable when you read the data. For example, in node using readFile:
In the browser, you can use the same technique. For example, in the web demo http://oss.sheetjs.com/js-xlsx you can save the workbook to a global variable: https://github.com/SheetJS/js-xlsx/blob/gh-pages/index.html#L195
In fact, you can even serialize the object with
JSON.stringify
and later reload it withJSON.parse
-- that's actually how we pass data from web worker to the main browser thread@WildDusk the suggestion from @reviewher is probably the best bet: just store the workbook somewhere as a global (as @reviewher explained), then attach an event handler to the select box that calls
process_wb(wb_global)
. If you would like to submit a PR with that change to the demo, we'll accept it :)