jspreadsheet / jspreadsheet/ce
Docs say `setData` triggers the `onload` event but it doesn't actually seem to
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 890
- PR merge metrics
- No merged PRs in 30d
Description
Titles explains it. Basically I've got a sheet with a couple of event functions attached to handle refreshing a chart and resizing the column widths.
Jspreadsheet CE is initially called like this:
const spreadsheet = jspreadsheet( spreadsheet_div, {
worksheets: [{
data: data,
allowComments: false,
minDimensions: [37, 17]
}],
onload: function(spreadsheet) {
// Run an auto width function to make the column widths match content
const worksheet = spreadsheet.worksheets[spreadsheet.getWorksheetActive()];
autoWidth(worksheet);
},
onafterchanges: function(worksheet, records) {
// Run an auto width function to make the column widths match content
autoWidth(worksheet, records);
// Update chart on spreadsheet changes
refreshChart();
}
});
Then when needed I run a setData call like this:
spreadsheet.setData( response.data );
The docs say that onload will run when setData is called to change/set the data in the sheet but this does not seem to actually happen. You'd potentially think that onafterchanges might run too since cells are changing, but it doesn't run either.
It's also worth noting that none of this fires after undo either, which seems counterintuitive in particular with onafterchanges.
This is with the latest (as I write this) v5 version of Jspreadsheet CE.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the setData entry point and the onload and onafterchanges callbacks, then compare their behavior with the documentation and with undo. Done means the documented callback behavior matches actual setData and undo behavior, with the reported spreadsheet refresh and resize use case covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100