Skip to content
Sheetwrite

@sheetwrite/core

SheetwriteAddonGridContextinterface

Report a problem

On this page

One new grid, with the settings it was created with for one add-on.

Members

Properties

readonly grid: Grid;

read-only

The new grid the add-on is attached to.

readonly settings: Settings | undefined;

read-only

Settings from createGrid(host, { addons: { [name]: settings } }), or undefined.

Methods

queryCommands(commands: QueryCommands): () => void;

Shows the grid's Get Data, Refresh All and Queries & Connections commands and connects them to commands. The grid removes them when it is destroyed; the returned function removes them earlier.

historyCommand(command: (action: "open" | "save") => void): void;

Shows the grid's Version History and Save Version commands; they call command with "open" or "save".

formulaSuggestions(suggester: FormulaSuggester): () => void;

Gives the grid's formula bar a suggester. While a formula is typed in the bar, its suggestion shows as dimmed text after the caret and Tab takes it. The grid removes it when it is destroyed; the returned function removes it earlier.

Declaration

View full TypeScript declaration
export interface SheetwriteAddonGridContext<Settings> {
readonly grid: Grid;
readonly settings: Settings | undefined;
queryCommands(commands: QueryCommands): () => void;
historyCommand(command: (action: "open" | "save") => void): void;
formulaSuggestions(suggester: FormulaSuggester): () => void;
}

Referenced by

Public exports naming SheetwriteAddonGridContext