- Index
- »
- fan.domkit
- »
- Table
Table
@Js
class Table : Elem
Table displays a grid of rows and columns.
See also: docDomkit
Constructor
Is the table header visible
Model for this table
Selection for table
List of CSS classes applied to rows in sequence, looping as required
Rebuild table layout
The column index by which the table is currently sorted, or null if the table is not currently sorted by a column
Callback when row is double-clicked
Callback when table is sorted by a column
Callback when a event occurs inside a table cell
Refresh table cell content
Sort a table by the given column index
Callback to display header popup
Return if the table is currently sorting up or down
Callback when selection has changed
Scroll to the given row and column in table
new make()
Constructor.
TableModel : model
Model for this table.
Void onAction(|This| f)
Callback when row is double-clicked.
Void onHeaderPopup(|Table->Popup| f)
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.
Void onSelect(|This| f)
Callback when selection has changed.
Void onSort(|This| f)
Callback when table is sorted by a column
Void onTableEvent(Str type, |TableEvent| f)
Callback when a event occurs inside a table cell.
Void rebuild()
Rebuild table layout.
Void refresh()
Refresh table cell content.
Void scrollTo(Int? col, Int? row)
Scroll to the given row and column in table. Pass null to maintain the current scroll position for that axis.
Selection : sel
Selection for table
Bool : showHeader
Is the table header visible.
Void sort(Int? col, Dir dir)
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.
Int? sortCol()
The column index by which the table is currently sorted, or null if the table is not currently sorted by a column. See sort.
Dir sortDir()
Return if the table is currently sorting up or down. See sort.
Str[] : stripeClasses
List of CSS classes applied to rows in sequence, looping as required.