DocAuthSpreadsheetEditorNEW
DocAuthSpreadsheetEditor:
{}A mounted spreadsheet editor.
Like DocAuthEditor, it can be created first and given a spreadsheet to show afterwards.
Examples
Section titled “Examples”// The two-phase shape: on screen immediately, filled when the file has been readconst editor = await system.createSpreadsheetEditor(target);editor.setCurrentSpreadsheet(await system.importSpreadsheet(file));// Tear down when the view goes away; the system stays alive for the next editoreditor.destroy();Methods
Section titled “Methods”setCurrentSpreadsheet()
Section titled “setCurrentSpreadsheet()”setCurrentSpreadsheet(
spreadsheet):void
Shows a spreadsheet, replacing whatever was showing before.
It must have come from the same system this editor did. The counterpart of
DocAuthEditor.setCurrentDocument.
Parameters
Section titled “Parameters”spreadsheet
Section titled “spreadsheet”Returns
Section titled “Returns”Example
Section titled “Example”editor.setCurrentSpreadsheet(await system.importSpreadsheet(nextFile));currentSpreadsheet()
Section titled “currentSpreadsheet()”currentSpreadsheet():
DocAuthSpreadsheet
The spreadsheet showing now.
Never null: an editor created without one opens on a blank spreadsheet.
Returns
Section titled “Returns”Example
Section titled “Example”downloadButton.onclick = async () => { const xlsx = await editor.currentSpreadsheet().export({ format: 'xlsx' }); // ... hand it to the user ...};activeSheet()
Section titled “activeSheet()”activeSheet():
number
Which sheet is showing, as a 0-based index. Right after DocAuthSpreadsheetEditor.setActiveSheet
it already names the requested sheet, before the switch is drawn.
Returns
Section titled “Returns”Example
Section titled “Example”// Export the sheet the user is looking atconst pdf = await editor.currentSpreadsheet().export({ format: 'pdf', sheet: editor.activeSheet() });setActiveSheet()
Section titled “setActiveSheet()”setActiveSheet(
index):void
Shows the sheet at a 0-based index. An index with no sheet, or a hidden sheet, leaves the editor where it is.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”docAuthSystem()
Section titled “docAuthSystem()”docAuthSystem():
DocAuthSystem
The system this editor was created by.
Returns
Section titled “Returns”destroy()
Section titled “destroy()”destroy():
void
Removes every element and releases every listener. Calling it twice is harmless. This does not
release the DocAuthSystem.