TableColumn
The configuration class for Table columns
Syntax
Table.columnTypeRegistry.foo = class FooColumn extends TableColumn {
...
}
new Table({
data: [...]
columns: [{ type: 'foo' }]
})
Options
If String, key is called on record and used to connect other columns with same splitInto key. If Function,
function is called with record as argument. If the function has an name (`function bats (hitter) { return hitter.bats }` vs `hitter => hitter.bats`)
then the name is used to connect to other columns with same named splitInto function, else strict equality on the function is used to connect
to other columns with same splitInto function.
types | description | arguments | |
---|---|---|---|
type
|
String |
Declares which column class from Table.columnTypeRegistry to use. Optional, default is TableColumn |
|
frozen
|
Boolean |
Make column stay in place when table body scrolls |
|
class
|
String |
classes to append to header and cells (space separated) |
|
render
|
Function |
Render method for the cell |
record:Object, cell:Element, columnConfiguration:Object, table:Table |
header
|
Function, String |
Render method for the header |
columnConfiguration:Object, table:Table |
width
|
String |
Valid value for css grid template (i.e. px, percent, min-content...) |
|
splitInto
|
Function, String |
split cell into multiple rows by the resulting of this method. Expected return is iterable (specifically responds to .map). |
record:Object |