class fwt::Table
sys::Obj fwt::Widget fwt::Table
Table displays grid of rows and columns.
- border
-
const Bool border := true
Draw a border around the widget. Default is true. This field cannot be changed once the widget is constructed.
- colAt
-
Get the zero based column index at the specified coordinate relative to this widget or null if not over a valid cell.
- hbar
-
@Transient
ScrollBar hbar := ... { private set }Horizontal scroll bar.
- headerVisible
-
Bool headerVisible
Is the header visible. Defaults to true.
- isColVisible
-
Return if the given column is visible. All columns are visible by default and can be toggled via
setColVisible
. - make
-
new make(|This|? f := null)
Default constructor.
- model
-
TableModel model := TableModel.<ctor>()
Backing data model of table.
- multi
-
const Bool multi := false
True to enable multi-row selection, false for single row selection. Default is false. This field cannot be changed once the widget is constructed.
- onAction
-
EventListeners onAction()
Callback when row is double clicked or Return/Enter key is pressed.
Event id fired:
Event fields:
Event.index
: the row index.
- onPopup
-
EventListeners onPopup()
Callback when user invokes a right click popup action. If the callback wishes to display a popup, then set the
Event.popup
field with menu to open. If multiple callbacks are installed, the first one to return a nonnull popup consumes the event.Event id fired:
Event fields:
Event.index
: the row index, ornull
if this is a background popup.Event.pos
: the mouse position of the popup.
- onSelect
-
EventListeners onSelect()
Callback when selected rows change.
Event id fired:
Event fields:
Event.index
: the primary selection row index.
- refreshAll
-
Void refreshAll()
Update the entire table's contents from the model.
- refreshRows
-
Void refreshRows(Int[] indices)
Update the rows at the selected indices
- rowAt
-
Get the zero based row index at the specified coordinate relative to this widget or null if not over a valid cell.
- selected
-
Int[] selected
Get and set the selected row indices. The indices match the logical model row indices which may not be consistent with the current view (if the user has resorted rows). No guarantee is made that indices are in sorted order.
- setColVisible
-
Void setColVisible(Int col, Bool visible)
Show or hide the given column. Changing visibility of columns does not modify the indexing of TableModel, it only changes how the model is viewed. See
isColVisible
. This method does not automatically refresh table, callrefreshAll
when complete. - sort
-
Void sort(Int? col, SortMode mode := SortMode.up)
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 seesortCol
andsortMode
. This method automatically refreshes the table. - sortCol
-
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
. - sortMode
-
SortMode sortMode()
Return if the table is currently sorting up or down. See
sort
. - vbar
-
@Transient
ScrollBar vbar := ... { private set }Vertical scroll bar.