Skip to main content
zerotal

Documentation


Documentation / @zerotal/admin / index / TableWidget

Class: TableWidget

Defined in: admin/src/widgets/Widget.ts:190

Extends

  • PollableWidget

Constructors

Constructor

new TableWidget(title, columns, resolver): TableWidget

Defined in: admin/src/widgets/Widget.ts:196

Parameters

title

string

columns

TableWidgetColumn[]

resolver

TableRowsResolver

Returns

TableWidget

Overrides

PollableWidget.constructor

Methods

poll()

poll(interval): this

Defined in: admin/src/widgets/Widget.ts:36

Re-render this widget every interval"10s", "1m". Costs a query per tick per viewer, so reach for it on dashboards that are watched, not on every widget by habit.

Parameters

interval

string

Returns

this

Inherited from

PollableWidget.poll


key()

key(key): this

Defined in: admin/src/widgets/Widget.ts:48

Name this widget, so a saved dashboard layout can refer to it.

Worth setting on any widget whose title might change: a layout keyed by title silently resets the moment somebody rewords a heading, whereas an explicit key survives it.

Parameters

key

string

Returns

this

Inherited from

PollableWidget.key


widgetKey()

widgetKey(index): string

Defined in: admin/src/widgets/Widget.ts:54

The identity a layout stores. Falls back to the title, then the position.

Parameters

index

number

Returns

string

Inherited from

PollableWidget.widgetKey


wide()

wide(value?): this

Defined in: admin/src/widgets/Widget.ts:204

Span the full dashboard width (default) or a single column.

Parameters

value?

boolean = true

Returns

this


rows()

rows(): Promise<Record<string, unknown>[]>

Defined in: admin/src/widgets/Widget.ts:209

Returns

Promise<Record<string, unknown>[]>