Class: CTableColumn

CTableColumn()

Base column class. This basic implementation can make search and sorting.

Constructor

new CTableColumn()

Trivial constructor. Call super() to create Component correctly.
Parameters:
Name Type Description
this.props.role string Control role: 'header', 'search', 'cell', 'footer', 'editor'.
this.props.column int Currnet column index.
this.props.row int Currnet row index, -1 for new row.
this.props.tab int Editor page, -1 for show on all pages.
this.props.sorting undefined | string Column sorting order: 'ASC', 'DESC' or ''. No sorting in `undefined`.
this.props.searching undefined | string Column searching: query string or ''. No search in `undefined`.
this.props.exact undefined | boolean Search only on exact match.
Source:

Methods

name() → {string}

Return column name. For use in subclesses.
Source:
Returns:
Current column name.
Type
string

on_changes(row, col, value)

Callback called if changes in another editor happens. For use in subclesses with `CTable.notify_changes` and `CTable.subscribe_to_changes`.
Parameters:
Name Type Description
row int Affected row
col int Affected column
value * New value
Source:

render() → {PreactNode}

Main render method. Call specific method by this.props.role.
Source:
Returns:
Cell control.
Type
PreactNode

render_cell() → {PreactNode}

Build view cell of table. For override in subclesses.
Source:
Returns:
Header control.
Type
PreactNode

render_editor() → {PreactNode}

Build editor control for cell. For override in subclesses.
Source:
Returns:
Editor control: `div` with `class="field"`.
Type
PreactNode
Build footer of column. For override in subclesses.
Source:
Returns:
Footer control.
Type
PreactNode

render_header() → {PreactNode}

Build header of column. For override in subclesses.
Source:
Returns:
Header control.
Type
PreactNode
Build search bar for column. For override in subclesses.
Source:
Returns:
Search control.
Type
PreactNode

row() → {Object|null}

Return current row values. For use in subclesses.
Source:
Returns:
Current row dictionary.
Type
Object | null

title() → {string}

Return column title. For use in subclesses.
Source:
Returns:
Current column title.
Type
string

value() → {*}

Return current cell value. For use in subclesses.
Source:
Returns:
Current cell value, default for new record or null if default is not set.
Type
*