Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Column<TRow>

A class responsible for handling a full column with its header.

Type parameters

  • TRow: __type

Hierarchy

  • Column

Index

Constructors

constructor

Properties

align

align: EColAlign

The alignment direction of the cells in this column.

class

class: TClassVal | function | null

The CSS class or a function returning CSS class(es) for cells of this column.

component

component: Vue | null

The component used to represent this cell.

field

field: keyof TRow | Path | null

The name of the field in the row object.

filterable

filterable: boolean

Controls whetever this column can be filtered.

headerAlign

headerAlign: EColAlign

The alignment direction of the header of this column.

headerClass

headerClass: "" = ""

The base CSS class to apply to the header component.

Optional headerComponent

headerComponent: Vue

The header cell component of the column.

interpolate

interpolate: false = false

Set to true to convert the return value of props.representedAs to HTML.

label

label: "" = ""

The label displayed in the header.

Private representedAs

representedAs: function | null

A transformation function that returns the string to display

sortable

sortable: boolean

Controls whetever this column can be sorted.

Methods

getRepresentation

  • getRepresentation(row: TRow): string
  • Converts a row to its string representation for the current column.

    Parameters

    • row: TRow

      The row to convert

    Returns string

    the string representation of this row in the current column.

matches

  • matches(row: TRow, filterString: string): boolean
  • Check if the provided row's representation matches a certain filter string.

    Parameters

    • row: TRow

      The row to check.

    • filterString: string

      The filter string to test.

    Returns boolean

    true if the row matches the filter, false otherwise.

Static isFilterable

  • Check if the column can be filtered.

    Parameters

    Returns boolean

    true if the column can be filtered, false otherwise

Static isPlainTextField

  • Check if the column use plain text value (eg representedAs or field, but not component) If multiple representation props are provided, it is considered as plain text if there are alternatives to component

    Parameters

    Returns boolean

    true if the column can be represented by plain text, false otherwise

Static isSortable

  • Check if the column can be sorted.

    Parameters

    Returns boolean

    true if the column can be sorted, false otherwise

Static normalizeAlignment

  • Normalize the alignment, using the requested default value.

    Parameters

    • align: string | EColAlign | undefined

      The raw desired alignment

    • Default value defaultAlign: EColAlign = EColAlign.Left

      The default alignment to use, if the 1st parameter isn't recognized

    Returns EColAlign

    the normalized alignment

Generated using TypeDoc