Table<T>
A custom table web component for BIM applications. HTML tag: bim-table
Extends
LitElement
Type parameters
| Type parameter | Value |
|---|---|
T extends TableRowData | TableRowData |
Properties
_lastSelectedData
Internal
_lastSelectedData:
null|Partial<T> =null
Tracks the last directly-selected row for Ctrl+click range selection.
dataTransform
dataTransform:
TableDataTransform<T> ={}
A property representing the rules for transforming table data. The keys of the object are the column names, and the values are functions that define the transformation logic.
Default Value
An empty object.
expanded
expanded:
boolean=false
A boolean property that determines whether the table is expanded or not.
When true, the table will be expanded to show all rows.
When false, the table will be collapsed to show only the top-level rows.
Default Value
false
Examples
table.expanded = true;
<bim-table expanded></bim-table>
filterFunction()?
optionalfilterFunction: (queryString,data) =>boolean
A function type representing the filter function for the table. This function is used to determine whether a given row of data should be included in the filtered results.
Parameters
| Parameter | Type | Description |
|---|---|---|
queryString | string | The search string used to filter the data. |
data | TableGroupData<T> | The data row to be filtered. |
Returns
boolean
groupingTransform
groupingTransform:
TableGroupingTransform<T> ={}
An object of functions used to transform data values before they are used for grouping logic. Each function is keyed by the column name and will be used to transform the value before grouping. This allows creating custom grouping categories (e.g., grouping S1,S2,S3,S4 all under "S").
Default Value
An empty object.
headersHidden
headersHidden:
boolean=false
A boolean property that determines whether the table headers are hidden.
Remarks
This property can be used to hide the table headers when needed.
Default Value
false
Examples
table.headersHidden = true;
<bim-table headers-hidden></bim-table>
indentationInText
indentationInText:
boolean=false
A boolean property that determines whether the table indentation should be included in the exported text.
Default Value
false
Example
table.indentationInText = true;
loadFunction?
optionalloadFunction:TableLoadFunction<T>
The function to be executed when loading async data using Table.loadData
preserveStructureOnFilter
preserveStructureOnFilter:
boolean=false
A boolean property that determines whether the table preserves its structure when filtering.
When true, the table will preserve its structure, showing only the filtered rows and their parents.
When false, the table will not preserve its structure, showing only the filtered rows.
Default Value
false
Example
table.preserveStructureOnFilter = true;
rangeSelectKey
rangeSelectKey:
"ctrlKey"|"shiftKey"|"altKey"|"metaKey"="ctrlKey"
The modifier key used for range selection (click one row, hold key, click another to select all in between).
Default Value
"ctrlKey"
styles
staticstyles:CSSResult[]
CSS styles for the component.
Overrides
LitElement.styles
Accessors
columns
setcolumns(value):void
Sets the columns for the table.
This property allows you to define the columns order for the table.
If this is not set, it will be computed from the table.data object.
The columns can be provided as an array of strings or objects of type ColumnData.
If the columns are provided as strings, they will be converted to ColumnData objects with a default width.
Example
const columns: (string | ColumnData)[] = [
"Column 1",
"Column 2",
{ name: "Column 3", width: "200px" },
];
table.columns = columns;
Parameters
| Parameter | Type | Description |
|---|---|---|
value | (keyof T | ColumnData<T>)[] | An array of strings or objects of type ColumnData. |
csv
getcsv():string
A getter function that generates a CSV (Comma Separated Values) representation of the table data.