@k8slens/extensions / Exports / Renderer / Component / TableProps
Interface: TableProps<Item>#
Type parameters#
Name |
---|
Item |
Hierarchy#
DOMAttributes
<HTMLDivElement
>
↳ TableProps
Table of contents#
Properties#
- autoSize
- className
- customRowHeights
- getTableRow
- items
- noItems
- onSort
- renderRow
- rowLineHeight
- rowPadding
- scrollable
- selectable
- selectedItemId
- sortByDefault
- sortSyncWithUrl
- sortable
- storageKey
- tableId
- virtual
- virtualHeight
Properties#
autoSize#
• Optional
autoSize: boolean
Setup auto-sizing for all columns (flex: 1 0)
className#
• Optional
className: string
Optional addition class names for the root HTML element
customRowHeights#
• Optional
customRowHeights: (item
: Item
, lineHeight
: number
, paddings
: number
) => number
Type declaration#
▸ (item
, lineHeight
, paddings
): number
Parameters#
Name | Type |
---|---|
item |
Item |
lineHeight |
number |
paddings |
number |
Returns#
number
getTableRow#
• Optional
getTableRow: (uid
: string
) => undefined
| null
| ReactElement
<TableRowProps
<Item
>, string
| JSXElementConstructor
<any
>>
Type declaration#
▸ (uid
): undefined
| null
| ReactElement
<TableRowProps
<Item
>, string
| JSXElementConstructor
<any
>>
Parameters#
Name | Type |
---|---|
uid |
string |
Returns#
undefined
| null
| ReactElement
<TableRowProps
<Item
>, string
| JSXElementConstructor
<any
>>
items#
• Optional
items: Item
[]
The raw data for the table
noItems#
• Optional
noItems: StrictReactNode
This is shown when items is empty
onSort#
• Optional
onSort: (params
: TableSortParams
) => void
Type declaration#
▸ (params
): void
callback on sort change
Default: global sync with url
Parameters#
Name | Type |
---|---|
params |
TableSortParams |
Returns#
void
renderRow#
• Optional
renderRow: (item
: Item
) => undefined
| null
| ReactElement
<TableRowProps
<Item
>, string
| JSXElementConstructor
<any
>>
Type declaration#
▸ (item
): undefined
| null
| ReactElement
<TableRowProps
<Item
>, string
| JSXElementConstructor
<any
>>
Parameters#
Name | Type |
---|---|
item |
Item |
Returns#
undefined
| null
| ReactElement
<TableRowProps
<Item
>, string
| JSXElementConstructor
<any
>>
rowLineHeight#
• Optional
rowLineHeight: number
Row line height in pixels
rowPadding#
• Optional
rowPadding: number
Row padding in pixels
scrollable#
• Optional
scrollable: boolean
Use scrollbar if content is bigger than parent's height
selectable#
• Optional
selectable: boolean
Highlight rows on hover
selectedItemId#
• Optional
selectedItemId: string
Allows to scroll list to selected item
sortByDefault#
• Optional
sortByDefault: Partial
<TableSortParams
>
default sorting params
sortSyncWithUrl#
• Optional
sortSyncWithUrl: boolean
sorting state is managed globally from url params
sortable#
• Optional
sortable: TableSortCallbacks
<Item
>
Define sortable callbacks for every column in <TableHead><TableCell sortBy="someCol"></TableCell></TableHead>
Sort Item
argument in the callback is an object, provided in <TableRow sortItem={someColDataItem}></TableRow>
storageKey#
• Optional
storageKey: string
Deprecated
Unused
tableId#
• Optional
tableId: string
Used for persisting sort order and visible columns
virtual#
• Optional
virtual: boolean
Use virtual list component to render only visible rows. By default uses a auto sizer to fill available height
virtualHeight#
• Optional
virtualHeight: number
Only used when virtual is true. Sets the virtual list to be a fixed height.
Needed when used in contexts that already have a parent component that
is overflow-y: scroll
,