Skip to content

defineWorkbookEditorElement

function defineWorkbookEditorElement(mount, tagName?): void;

Defines , usable from any framework or plain HTML.

Attributes: src (URL of a workbook or CSV file to open), file-name, and save-handler="event" to receive saves as save events instead of a download. Properties: options (editor options). Methods: open(), save(), downloadCopy(), getWorkbook(), downloadCsv(), getCsv(), goTo(), registerSchema(), removeSchema(), setTheme(), setLanguage(), setUser(), setCustomLists(). Events: ready, opened (detail: { fileName }), change (detail: { editedCount, unsaved }), save (detail: the saved workbook with its bytes, changes, values and readers; call detail.waitUntil(promise) to keep the save pending while you store it), and editorerror (detail: { message }) when a workbook from src can’t be loaded or opened, or the editor stops working.

Parameter Type Default value
mount Mount undefined
tagName string 'workbook-editor'

void