cycyexcel
中文0.2.0

API

createWorkbook()

Create a multi-sheet workbook with bottom tabs and an add-sheet button.

Signature

ts
function createWorkbook(
  container: HTMLElement,
  options?: CreateWorkbookOptions
): WorkbookHandle
NameTypeDescription
sheetsWorkbookSheetOptions[]Initial sheets, each with its own columns and snapshot.
toolbarboolean | ToolbarOptionsDefaults to true. Controls each sheet's toolbar.
formulaBarbooleanDefaults to true. Controls each sheet's formula bar.
newSheetRowsnumberThe initial blank row count for a new sheet. Defaults to 1000.
...CyExcelCoreOptionsobjectDefault core options for all initial sheets. Per-sheet options take precedence.

WorkbookHandle

NameTypeDescription
getActiveSheet()CyExcelCoreReturn the active sheet's core instance.
setActiveSheet(sheetId)voidSwitch the active sheet.
addSheet(options?)stringAppend a sheet and return its ID.
replaceSheets(sheets)readonly string[]Replace all worksheets and return the new IDs. All snapshots are validated and the first replacement mounts before old sheets are released. Replacement clears undo history.
——For row insertion and deletion, use insertRows() / deleteRows() on the active CyExcelCore, not WorkbookHandle.
dispose()voidDispose all sheets and the tab bar.

Examples