class domkit::Table

sys::Obj
  dom::Elem
    domkit::Table

@Js

Source

Table displays a grid of rows and columns.

See also: docDomkit

make

new make()

Source

Constructor.

model

TableModel model := TableModel.<ctor>()

Source

Model for this table.

onAction

Void onAction(|This| f)

Source

Callback when row is double-clicked.

onHeaderPopup

Void onHeaderPopup(|Table->Popup| f)

Source

Callback to display header popup. When non-null, a button will be placed on the right-hand side of the table header to indicate the popup is available.

onSelect

Void onSelect(|This| f)

Source

Callback when selection has changed.

onSort

Void onSort(|This| f)

Source

Callback when table is sorted by a column

onTableEvent

Void onTableEvent(Str type, |TableEvent| f)

Source

Callback when a event occurs inside a table cell.

rebuild

Void rebuild()

Source

Rebuild table layout.

refresh

Void refresh()

Source

Refresh table cell content.

scrollTo

Void scrollTo(Int? col, Int? row)

Source

Scroll to the given row and column in table. Pass null to maintain the current scroll position for that axis.

sel

Selection sel { private set }

Source

Selection for table

showHeader

Bool showHeader := true

Source

Is the table header visible.

sort

Void sort(Int? col, Dir dir := Dir.up)

Source

Sort a table by the given column index. If col is null, then the table is ordered by its natural order of the table model. Sort order is determined by TableModel.sortCompare. Sorting does not modify the indexing of TableModel, it only changes how the model is viewed. Also see sortCol and sortDir. Table automatically refreshed.

sortCol

Int? sortCol()

Source

The column index by which the table is currently sorted, or null if the table is not currently sorted by a column. See sort.

sortDir

Dir sortDir()

Source

Return if the table is currently sorting up or down. See sort.

stripeClasses

Str[] stripeClasses := Str["even","odd"]

Source

List of CSS classes applied to rows in sequence, looping as required.