Class zwt.ui.table.Table
Extends
zwt.ui.Widget.
The table widget is used to display two-dimensional tables of cells. It provides sorting facilities over columns. It is also possible to resize columns and edit cell values.
The table widget uses a zwt.ui.table.TableModel to determine how data are displayed in the table.
It also uses a zwt.ui.table.TableSelectionModel to handle single or multiple row, column or cell selection. The selection behavior (how table element are selected by the UI) is specified in a zwt.ui.table.TableSelector.
CSS rules
.zwt_table {}
.zwt_table .zwt_table-cursor {}
.zwt_table .zwt_table-resizer {}
.zwt_table .zwt_table-headerTop {}
.zwt_table .zwt_table-headerTop .zwt_table-cell {}
.zwt_table .zwt_table-headerTop .zwt_table-cell-ascending {}
.zwt_table .zwt_table-headerTop .zwt_table-cell-descending {}
.zwt_table .zwt_table-body {}
.zwt_table .zwt_table-body .zwt_table-row {}
.zwt_table .zwt_table-body .zwt_table-row-even {}
.zwt_table .zwt_table-body .zwt_table-row-odd {}
.zwt_table .zwt_table-body .zwt_table-row-selected {}
.zwt_table .zwt_table-body .zwt_table-cell {}
.zwt_table .zwt_table-body .zwt_table-cell-selected {}
Defined in: Table.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Construct a table.
|
Method Attributes | Method Name and Description |
---|---|
convertColIndexToModel(int_viewIndex)
Convert the specified column index from the view to the model.
|
|
convertColIndexToView(int_modelIndex)
Convert the specified column index from the model to the view.
|
|
convertRowIndexToModel(int_viewIndex)
Convert the specified row index from the view to the model.
|
|
convertRowIndexToView(int_modelIndex)
Convert the specified row index from the model to the view.
|
|
Return the column model that provides properties on the table columns.
|
|
getModel()
Return the table model that provides the data displayed by the table.
|
|
Return the row sorter that provides mapping between indices in the model and the view.
|
|
Return the selection model used to maintain selection state.
|
|
Return the selector used to select cells, rows or columns in the table.
|
|
Hide the editor.
|
|
processFocusEvent(zwt_event_FocusEvent_event)
Process the specified focus event.
|
|
setColumnModel(zwt_ui_table_ColumnModel_model)
Set the table column model.
|
|
setModel(zwt_ui_table_TableModel_model)
Set the table model.
|
|
setRowSorter(zwt_ui_table_RowSorter_sorter)
Set the row sorter for the table.
|
|
setSelectionModel(zwt_ui_table_TableSelectionModel_model)
Set the selection model.
|
|
setSelector(zwt_ui_table_TableSelector_selector)
Set the table selector.
|
|
Show the editor for the cell at the current cursor location.
|
- Methods borrowed from class zwt.ui.Widget:
- addStyle, draw, getContextFill, getDimension, getElement, getElementDimension, getFill, getFocusEventManager, getId, getKeyboardEventManager, getParent, getRelativeLeft, getRelativeTop, getStyle, getWheelEventManager, hasFocus, hasStyle, isFocusable, isVisible, onEvent, processContentEvent, processEvent, processKeyboardEvent, processWheelEvent, redraw, removeStyle, replaceStyle, setFill, setFocusable, setId, setStyle, setVisible
Method Detail
convertColIndexToModel(int_viewIndex)
Convert the specified column index from the view to the model.
- Parameters:
- {Integer} int_viewIndex
- The index of the column in the view
convertColIndexToView(int_modelIndex)
Convert the specified column index from the model to the view.
- Parameters:
- {Integer} int_modelIndex
- The index of the column in the model
convertRowIndexToModel(int_viewIndex)
Convert the specified row index from the view to the model.
- Parameters:
- {Integer} int_viewIndex
- The index of the row in the view
convertRowIndexToView(int_modelIndex)
Convert the specified row index from the model to the view.
- Parameters:
- {Integer} int_modelIndex
- The index of the row in the model
{zwt.ui.table.ColumnModel}
getColumnModel()
Return the column model that provides properties on the table columns.
- Returns:
- The column model
{zwt.ui.table.TableModel}
getModel()
Return the table model that provides the data displayed by the table.
- Returns:
- The table model
{zwt.ui.table.RowSorter}
getRowSorter()
Return the row sorter that provides mapping between indices in the model and the view.
- Returns:
- The table row sorter.
{zwt.ui.table.TableSelectionModel}
getSelectionModel()
Return the selection model used to maintain selection state.
- Returns:
- The selection model.
{zwt.ui.table.TableSelector}
getSelector()
Return the selector used to select cells, rows or columns in the table.
- Returns:
- The selector
hideEditor()
Hide the editor.
processFocusEvent(zwt_event_FocusEvent_event)
Process the specified focus event.
- Parameters:
- {zwt.event.FocusEvent} zwt_event_FocusEvent_event
- The focus event to process
setColumnModel(zwt_ui_table_ColumnModel_model)
Set the table column model. A column model is used to determine how the columns must be displayed in the table
- Parameters:
- {zwt.ui.table.ColumnModel} zwt_ui_table_ColumnModel_model
- The column model to set
setModel(zwt_ui_table_TableModel_model)
Set the table model.
- Parameters:
- {zwt.ui.table.TableModel} zwt_ui_table_TableModel_model
- The table model to set.
setRowSorter(zwt_ui_table_RowSorter_sorter)
Set the row sorter for the table. The table requires a row sorter to work correctly and therefore we can't set a null value.
- Parameters:
- {zwt.ui.table.RowSorter} zwt_ui_table_RowSorter_sorter
- A non-null row sorter to set.
setSelectionModel(zwt_ui_table_TableSelectionModel_model)
Set the selection model.
- Parameters:
- {zwt.ui.table.TableSelectionModel} zwt_ui_table_TableSelectionModel_model
- The selection model to set.
setSelector(zwt_ui_table_TableSelector_selector)
Set the table selector. A selector defines the selection behavior of the table.
A selector is tightly linked to the table, therefore a selector instance must not be used in several table instances.
- Parameters:
- {zwt.ui.table.TableSelector} zwt_ui_table_TableSelector_selector
- The selector to set
showEditor()
Show the editor for the cell at the current cursor location. If the column doesn't authorize cell edition or if the model doesn't authorize edition on the cell then this method has no effect.