Class zwt.ui.table.TableSelectionModel
Extends
zwt.Object.
A table selection model represents the current state of the selection in a table.
Every methods that modify the selection use an array of cells in the data model. A cell is represented by an array of two elements: the row index and the column index in the data model.
In order to enable cell selection in a Table, use a zwt.ui.table.CellSelectionModel.
In order to enable row selection in a Table, use a zwt.ui.table.RowSelectionModel.
In order to enable column selection in a Table, use a zwt.ui.table.ColumnSelectionModel.
You can also provide your own implementation for specific selection models.
Defined in: TableSelectionModel.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Construct a table selection model.
|
Method Attributes | Method Name and Description |
---|---|
addSelection(array_cells, boolean_exclusive)
Add to the current selection using the specified array of cells.
|
|
Change the selection to the empty set.
|
|
Return the selection model event manager attached to the model.
|
|
isCellSelected(int_rowIndex, int_colIndex)
Determine whether the specified cell is selected.
|
|
isColumnSelected(int_rowIndex)
Determine whether the specified column is selected.
|
|
isRowSelected(int_rowIndex)
Determine whether the specified row is selected.
|
|
isSelectable(int_rowIndex, int_colIndex)
Determine whether the specified cell is selectable.
|
|
onEvent(zwt_ui_table_TableSelectionModelEvent_event)
Dispatch the specified selection model event to the appropriate event manager.
|
|
removeSelection(array_cells)
Remove from the current selection using the specified array of cells.
|
|
setSelection(array_cells, boolean_exclusive)
Change the selection using the specified array of cells.
|
|
shiftRows(array_rows, boolean_remove)
Shift the row indices of current selection.
|
Author: Jeremy KUHN.
If this represents a change to the current selection then an event is emitted to notify the change.
- Parameters:
- {Integer[][]} array_cells
- The array of cells in the underlying model to use to add to the selection
- {Boolean} boolean_exclusive
- If exclusive, the change should deselect currently selected data
If this represents a change to the current selection then an event is emitted to notify the change.
- Returns:
- The selection model event manager
This method always returns false by default. You may need to override this method for specific implementation.
- Parameters:
- {Integer} int_rowIndex
- The index of the row in the data model
- {Integer} int_colIndex
- The index of the column in the data model
- Returns:
- true if the cell is selected, false otherwise
This method always returns false by default. You may need to override this method for specific implementation.
- Parameters:
- {Integer} int_rowIndex
- The index of the column in the data model
- Returns:
- true if the column is selected, false otherwise.
This method always returns false by default. You may need to override this method for specific implementation.
- Parameters:
- {Integer} int_rowIndex
- The index of the row in the data model
- Returns:
- true if the row is selected, false otherwise
This method always returns true. You may override this method to make a specific row/column/cell unselectable.
- Parameters:
- {Integer} int_rowIndex
- The index of the row in the data model
- {Integer} int_colIndex
- The index of the column in the data model
- Returns:
- true if the cell is selectable, false otherwise
- Parameters:
- {zwt.ui.table.TableSelectionModelEvent} zwt_ui_table_TableSelectionModelEvent_event
- The selection model event to dispatch
If this represents a change to the current selection then an event is emitted to notify the change.
- Parameters:
- {Integer[][]} array_cells
- The array of cells in the underlying model to use to remove from the selection
If this represents a change to the current selection then an event is emitted to notify the change.
- Parameters:
- {Integer[][]} array_cells
- The array of cells in the underlying model to use to change the selection
- {Boolean} boolean_exclusive
- If exclusive, the change should deselect currently selected data.
This method is called to sync the selection model with a corresponding change in the data model.
- Parameters:
- {Integer[]} array_rows
- the list of rows (indices) to consider for the shift
- {Boolean} boolean_remove
- If true, remove from the row indices