Back to Beekeeper Studio

Table API

apps/ui-kit/docs/api/table.md

5.7.26.5 KB
Original Source

Table API

Properties

NameTypeDescriptionDefault
namestringThe name of the table.table
dataobject[]An array of objects representing the table data where the keys are the column fields.[]
columnsobject[]An array of objects representing the table columns. See Column Definition below for more details.[]
cellContextMenuItemsobject[] | functionExtend the cell context menu. See Context Menu for more details.undefined
rowContextMenuItemsobject[] | functionExtend the row context menu. See Context Menu for more details.undefined
columnHeaderContextMenuItemsobject[] | functionExtend the column header context menu. See Context Menu for more details.undefined
rowHeaderContextMenuItemsobject[] | functionExtend the row header context menu. See Context Menu for more details.undefined
cornerHeaderContextMenuItemsobject[] | functionExtend the corner header context menu. See Context Menu for more details.undefined
tabulatorOptionsobjectExtend the tabulator definition. See Tabulator docs for more details.undefined

Column Definition

NameTypeDescriptionDefault
field<sup>required</sup>stringThe key of the column in the data array.
titlestringThe title of the column displayed in the table header. If not provided, the field will be used.undefined
editablebooleanMake the column editable.false
dataTypestringThe data type of the column.undefined
cssClassstringThe CSS class to apply to the column.undefined
sorterstring | 'none'The sorter to use for the column. Use none to disable sorting. Also see the built-in sorters from tabulator for more options.undefined
primaryKeybooleanMake the column a primary key. If true, the column header will indicate that it is a primary key.undefined
foreignKeybooleanSimilar to primaryKey.undefined
generatedbooleanSimilar to primaryKey.undefined
tabulatorColumnDefinitionobject | functionExtend the tabulator column definition. See Tabulator docs for more details.undefined

Methods

NameDescriptionArguments
getTabulator()Returns the Tabulator instance. See Tabulator docs for more information.-

Events

NameDescriptionEvent Detail
bks-initializedEmitted when the Table is initialized.{ tabulator: Tabulator }
bks-sorters-changeEmitted when the sorters are changed.{ sorters: { field: string, dir: 'asc' | 'desc' }[] }
bks-ranges-changeEmitted when the ranges are changed.{ ranges: TabulatorRange[] }
bks-foreign-key-go-toEmitted when the foreign key go to button is clicked.{ value: any; field: string; cell: Tabulator.CellComponent; }