public class TableView extends Container:
Spreadsheet-like table widget backed by a TableModel.
import klyn.gui.windows
import klyn.gui.windows.events
model = TableModel("users").addColumn("id").addColumn("login")
model.addRow(["1", "admin"])
table = TableView(model)
table.cellSelected += lambda(event: TableCellEvent): print(table.selectedValue)| Modifier and Type | Member | Description |
|---|---|---|
| public property | editOnSingleClickeditOnSingleClick as Boolean = false |
Starts editing an editable cell on the first primary-button click. |
| public readonly property | isEditingisEditing as Boolean: |
Whether a cell currently owns the inline text editor. |
| public property | modelmodel as TableModel: |
Data model rendered by the view. |
| public property | rowActionIconrowActionIcon as Icon = null |
Icon displayed in each leading row-action cell. |
| public property | rowActionToolTiprowActionToolTip as String = "Row action" |
Tooltip displayed while the pointer is over a row-action cell. |
| public property | rowActionWidthrowActionWidth as Int = 42 |
Width in pixels of the optional leading row-action column. |
| public property | selectedColumnselectedColumn as Int = -1 |
No summary. |
| public property | selectedRowselectedRow as Int = -1 |
No summary. |
| public readonly property | selectedValueselectedValue as String: |
Text value of the selected cell, or an empty string when none is selected. |
| public property | showRowActionsshowRowActions as Boolean = false |
Whether a compact action cell is displayed before each data row. |
| public property | sortColumnsortColumn as Int = -1 |
Column carrying the optional visual sort indicator, or -1. |
| public property | sortDescendingsortDescending as Boolean = false |
Whether the visual sort indicator points toward descending values. |
| Modifier and Type | Member | Description |
|---|---|---|
| public event | cellEditFinishedcellEditFinished as TableCellEditEvent |
Emitted after an inline cell edition has been accepted or rejected. |
| public event | cellSelectedcellSelected as TableCellEvent |
Emitted when the current cell changes by mouse or keyboard. |
| public event | headerClickedheaderClicked as TableHeaderEvent |
Emitted when a column header is clicked. |
| public event | rowActionRequestedrowActionRequested as TableRowActionEvent |
Emitted when the optional leading action cell of a row is clicked. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | TableViewTableView(model as TableModel = null): |
Creates a table view with an optional model. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | beginEdit | Starts inline edition of an editable cell. |
| public | cancelEditcancelEdit(restoreFocus as Boolean = true) as Void: |
Cancels the current inline edition without updating the model. |
| public | commitEditcommitEdit() as Boolean: |
Submits the current inline value to the table model. |
| public override | paintpaint(painter as Painter) as Void: |
No summary. |
| public override | setBounds | No summary. |
| public | setSelectedValue | Updates the selected cell when the model is editable. |