Canvas Toolkit
← Class index

CTableWidget

Widgets · extends CTableView

Implements the table widget widget.

import { CTableWidget } from "canvas-toolkit-lib";

Declared members

readonly clearRejected: CSignal<[row: number, column: number]>;

Reports the first selected cell that cannot be cleared.

readonly currentItemChanged: CSignal<[CTableWidgetItem | null, CTableWidgetItem | null]>;

Signal emitted when current item changes.

constructor(parent?: CWidget | null);

Creates a new instance.

protected contextCellActions(): {
        enabled: boolean;
        cut: () => void;
        clear: () => void;
    } | null;
clearSelectedCells(): void;

Clears editable selected cells as a single undo command.

cutSelection(writeText?: (text: string) => void): void;

Cuts the selection after validating all its cells.

contentKeyPressEvent(event: CKeyEvent): void;
rowCount(): number;

Provides row count behavior.

setRowCount(count: number): void;

Sets the row count.

columnCount(): number;

Provides column count behavior.

setColumnCount(count: number): void;

Sets the column count.

item(row: number, column: number): CTableWidgetItem | null;

Provides item behavior.

setItem(row: number, column: number, item: CTableWidgetItem): void;

Sets the item.

takeItem(row: number, column: number): CTableWidgetItem | null;

Removes and returns item.

setHorizontalHeaderLabels(labels: string[]): void;

Sets the horizontal header labels.

setVerticalHeaderLabels(labels: string[]): void;

Sets the vertical header labels.

currentItem(): CTableWidgetItem | null;

Returns the current item.

setCurrentItem(item: CTableWidgetItem | null): void;

Sets the current item.

selectedItems(): CTableWidgetItem[];

Returns the selected items.

itemFromIndex(index: CModelIndex): CTableWidgetItem | null;

Provides item from index behavior.

indexFromItem(item: CTableWidgetItem): CModelIndex;

Provides index from item behavior.