Package com.smartgwt.client.widgets.grid
Class CellSelection
java.lang.Object
com.smartgwt.client.core.BaseClass
com.smartgwt.client.widgets.grid.CellSelection
- All Implemented Interfaces:
HasHandlers
Maintains a representation of selection over a 2-dimensional grid of objects.
Automatically created to manage cell-selection on
Automatically created to manage cell-selection on
CubeGrid
widgets.-
Field Summary
Fields inherited from class com.smartgwt.client.core.BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIs anything in the list selected?cellIsSelected
(int rowNum, int colNum) Return true if a particular item is selectedcreate()
deselectCell
(int rowNum, int colNum) Deselect a particular celldeselect an array of cellsdeselectCellList
(int[][] cells) getJsObj()
static CellSelection
getOrCreateRef
(JavaScriptObject jsObj) int[][]
Returns an array of the currently selected cells.Returns the first record that has any cells selected.boolean
selectCell
(int rowNum, int colNum) Select a particular cellselect an array of cellsselectCellList
(int[][] cells) void
Method called whenever the cell selection is modifiedselectSingleCell
(int rowNum, int colNum) select a single cell and deselect everything elsevoid
Methods inherited from class com.smartgwt.client.core.BaseClass
addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setID, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName
-
Constructor Details
-
CellSelection
public CellSelection() -
CellSelection
-
-
Method Details
-
getOrCreateRef
-
setJavaScriptObject
- Overrides:
setJavaScriptObject
in classBaseClass
-
create
-
isCreated
public boolean isCreated() -
getJsObj
-
getOrCreateJsObj
- Overrides:
getOrCreateJsObj
in classBaseClass
-
anySelected
Is anything in the list selected?- Returns:
- true == at least one item is selected false == nothing at all is selected
- See Also:
-
cellIsSelected
Return true if a particular item is selected- Parameters:
rowNum
- row index of the cell to checkcolNum
- column index of the cell to check- Returns:
- true == object is selected false == object is not selected
- See Also:
-
deselectCell
Deselect a particular cell- Parameters:
rowNum
- row index of the cell to selectcolNum
- column index of the cell to select- Returns:
- true == selection actually changed, false == no change
- See Also:
-
getSelectedRecord
Returns the first record that has any cells selected.- Returns:
- first selected record, or null if nothing selected
- See Also:
-
selectCell
Select a particular cell- Parameters:
rowNum
- row index of cell to selectcolNum
- column index of cell to select- Returns:
- true == selection actually changed, false == no change
- See Also:
-
selectionChanged
public void selectionChanged()Method called whenever the cell selection is modified- See Also:
-
selectSingleCell
select a single cell and deselect everything else- Parameters:
rowNum
- row index of cell to selectcolNum
- column index of cell to select- Returns:
- true == selection actually changed, false == no change
- See Also:
-
getSelectedCells
public int[][] getSelectedCells()Returns an array of the currently selected cells. Each cell is returned as a 2 element array in the form[rowNum, colNum]
.- Returns:
- an array of the selected cells, as 2 element arrays
- See Also:
-
deselectCellList
deselect an array of cells- Returns:
- true == selection actually changed, false == no change
- See Also:
-
deselectCellList
-
selectCellList
select an array of cells- Returns:
- true == selection actually changed, false == no change
- See Also:
-
selectCellList
-