Samples / guidance for use in Knockout js #1061
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#1061
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?
I've been trying to get files read and passed to the viewmodel in knockout js - there's details in this question at StackOverflow
I have the data back up in the viewmodel now, but I'm not quite sure how to access it for binding, et al. The data comes back as an object, with the sheet(s) as arrays within the object, and I can't quite get at it.
I've not found any examples or info on using the package in Knockout, and I've been hacking my way through it myself. Some direction on some samples would be useful.,
At some point we'll think about putting together a more complete demo. For now, hopefully this fiddle suffices: https://jsfiddle.net/sheetjs/xpu12hwu/
The core idea is to generate a data table from an array of arrays structure. The template is straightforward:
The model is set up with an AOA:
That
model
variable is visible to other functions, like the actual file input callback. The skeleton block is identical to the HTML5 file input example.Once the workbook is read, the first worksheet is converted to an array of arrays and the model is updated: