Interface CreateTableModelPara

Parameters of TableFactory.createTableModel – pass any subset (Partial<CreateTableModelPara>).

Three typical combinations:

You have … Pass Training
an array of objects rows (+ properties or columnDefs) chapter 12, 13
rows of values (CSV, matrix) headerData, bodyData, footerData, columnSizes chapter 14
own area models headerAreaModel, bodyAreaModel, footerAreaModel + columnDefs chapter 15–17

Everything not given is derived: column definitions from properties or the keys of the first row (header label = key in upper case, width 200 px), area models from the data, row heights from tableOptions.defaultRowHeights.

Example

const tableModel = TableFactory.createTableModel({
rows: orders, // Order[]
columnDefs: [new ColumnDef("id", "ID", px80, allRight), new ColumnDef("customer", "Customer", px180)],
fixedLeftColumnCount: 1,
tableOptions
});

Hierarchy

  • CreateTableModelPara

Properties

bodyAreaModel: AreaModelIf

Model of the body. Default: built from rows (objects or tree rows) or bodyData. See AreaModel for own models.

bodyData: any[][]

The body as rows of values (any[][]).

columnCount: number

Number of columns. Default: derived from columnDefs, headerData or columnSizes.

columnDefs: ColumnDefIf[]

The columns: property, header label, width, classes, renderers, sorting, editing. See ColumnDef.

columnSizes: number[]

Column widths in px – the simple alternative to columnDefs (e.g. with bodyData).

defaultRowHeights: DefaultRowHeightsIf

Row heights of header, body and footer in px. Default: tableOptions.defaultRowHeights, otherwise 34 / 34 / 34.

fixedLeftColumnCount: number

Number of columns fixed on the left (side "west"). Default 0.

fixedRightColumnCount: number

Number of columns fixed on the right (side "east"). Default 0.

footerAreaModel: AreaModelIf

Model of the footer. Default: footerData, otherwise no footer. Totals that follow the filter: an own AreaModel.

footerData: string[][]

Footer rows as values (static – they don't follow filter or edits).

getSelectionModel: GetT<SelectionModelIf>

Selection model factory. Default: tableOptions.getSelectionModel.

headerAreaModel: AreaModelIf

Model of the header. Default: one header row from the headerLabels of columnDefs, or headerData.

headerData: string[][]

Header rows as values – several rows are possible.

overridingColumnWidth: number

A width in px for all columns; -1 (default) = use the column definitions.

parentSize: number

Width of the parent element in px, used for percentage column widths before the first render (default 400).

properties: string[]

Which properties of rows become columns, in this order (ignored if columnDefs is given).

rowCheckboxVisible: boolean

Show a checkbox column for every row. Default false.

rows: any[]

The rows as objects (T[]) or tree rows from TreeFactory.buildTreeRows.

tableOptions: TableOptionsIf

Options of the table; the factory reads defaultRowHeights, getSelectionModel and showCheckboxWihoutExtraColumn.