Skip to content

@jimka/typescript-ui / component/table / Column

Class: Column

Defined in: src/typescript/lib/component/table/Column.ts:17

Resolved presentation descriptor for a single table column.

Created internally by Column.resolve — not constructed directly by application code. Wraps a Field and carries optional width constraints and an initial visibility flag derived from a ColumnSpec.

Re-exported as TableColumn from the package barrel.

Constructors

new Column()

ts
new Column(field: Field, config?: ColumnConfig): Column

Defined in: src/typescript/lib/component/table/Column.ts:31

Constructs a Column from a field and an optional presentation config.

Parameters

field

Field

The model field this column represents.

config?

ColumnConfig

Optional config; all constraint properties default to absent / false.

Returns

Column

Methods

clearHeaderGlyph()

ts
clearHeaderGlyph(): this

Defined in: src/typescript/lib/component/table/Column.ts:103

Clears the header glyph for this column. Equivalent to setHeaderGlyph(null).

Returns

this

This column, for method chaining.


getField()

ts
getField(): Field

Defined in: src/typescript/lib/component/table/Column.ts:44

Returns the model field this column represents.

Returns

Field

The underlying Field.


getHeaderGlyph()

ts
getHeaderGlyph(): null | string

Defined in: src/typescript/lib/component/table/Column.ts:80

Returns the registry glyph name shown to the left of this column's header text.

Returns

null | string

The glyph registry name, or null if no header glyph is set.


getMaxWidth()

ts
getMaxWidth(): undefined | number

Defined in: src/typescript/lib/component/table/Column.ts:62

Returns the maximum column width in pixels declared in the spec.

Returns

undefined | number

The maximum width, or undefined if unconstrained.


getMinWidth()

ts
getMinWidth(): undefined | number

Defined in: src/typescript/lib/component/table/Column.ts:53

Returns the minimum column width in pixels declared in the spec.

Returns

undefined | number

The minimum width, or undefined if unconstrained.


isInitiallyHidden()

ts
isInitiallyHidden(): boolean

Defined in: src/typescript/lib/component/table/Column.ts:71

Returns whether this column starts hidden according to the spec.

Returns

boolean

true if the spec declared hidden: true for this column.


setHeaderGlyph()

ts
setHeaderGlyph(name: null | string): this

Defined in: src/typescript/lib/component/table/Column.ts:92

Sets the registry glyph name shown to the left of this column's header text.

Pass null (or call Column.clearHeaderGlyph) to remove the glyph.

Parameters

name

A registered glyph name, or null to remove.

null | string

Returns

this

This column, for method chaining.


resolve()

ts
static resolve(fields: Field[], spec?: ColumnSpec): Column[]

Defined in: src/typescript/lib/component/table/Column.ts:127

Resolves a ColumnSpec against a set of model fields into an ordered array of Column instances.

When no spec is provided every field becomes a default Column, preserving existing table behaviour exactly.

When a spec is provided:

  • Fields listed in spec.columns receive their declared constraints.
  • Fields not listed are appended as default Columns when appendUnlisted is true (the default), or omitted entirely when it is false.

The returned array is sorted by Field.getOrder so that the column sequence matches the order used by the header and body renderers.

Parameters

fields

Field[]

All fields returned by the model.

spec?

ColumnSpec

Optional column spec; omit to auto-generate from all fields.

Returns

Column[]

Resolved Column instances in display order.