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`

public class CellSelection extends BaseClass
Maintains a representation of selection over a 2-dimensional grid of objects.
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

  Constructors
  Constructor
  Description
  `CellSelection()`
  `CellSelection(JavaScriptObject jsObj)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Boolean`
  `anySelected()`
  Is anything in the list selected?
  `Boolean`
  `cellIsSelected(int rowNum, int colNum)`
  Return true if a particular item is selected
  `JavaScriptObject`
  `create()`
  `Boolean`
  `deselectCell(int rowNum, int colNum)`
  Deselect a particular cell
  `Boolean`
  `deselectCellList()`
  deselect an array of cells
  `Boolean`
  `deselectCellList(int[][] cells)`
  `JavaScriptObject`
  `getJsObj()`
  `JavaScriptObject`
  `getOrCreateJsObj()`
  `static CellSelection`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `int[][]`
  `getSelectedCells()`
  Returns an array of the currently selected cells.
  `ListGridRecord`
  `getSelectedRecord()`
  Returns the first record that has any cells selected.
  `boolean`
  `isCreated()`
  `Boolean`
  `selectCell(int rowNum, int colNum)`
  Select a particular cell
  `Boolean`
  `selectCellList()`
  select an array of cells
  `Boolean`
  `selectCellList(int[][] cells)`
  `void`
  `selectionChanged()`
  Method called whenever the cell selection is modified
  `Boolean`
  `selectSingleCell(int rowNum, int colNum)`
  select a single cell and deselect everything else
  `void`
  `setJavaScriptObject(JavaScriptObject jsObj)`

  ### 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CellSelection

    public CellSelection()

  - ### CellSelection

    public CellSelection(JavaScriptObject jsObj)

- ## Method Details

  - ### getOrCreateRef

    public static CellSelection getOrCreateRef(JavaScriptObject jsObj)

  - ### setJavaScriptObject

    public void setJavaScriptObject(JavaScriptObject jsObj)
    Overrides:
      `setJavaScriptObject` in class `BaseClass`

  - ### create

    public JavaScriptObject create()
    Specified by:
      `create` in class `BaseClass`

  - ### isCreated

    public boolean isCreated()
    Overrides:
      `isCreated` in class `BaseClass`

  - ### getJsObj

    public JavaScriptObject getJsObj()
    Overrides:
      `getJsObj` in class `BaseClass`

  - ### getOrCreateJsObj

    public JavaScriptObject getOrCreateJsObj()
    Overrides:
      `getOrCreateJsObj` in class `BaseClass`

  - ### anySelected

    public Boolean anySelected()
    Is anything in the list selected?
    Returns:
      true == at least one item is selected false == nothing at all is selected
    See Also:
      - `Selection`

  - ### cellIsSelected

    public Boolean cellIsSelected(int rowNum, int colNum)
    Return true if a particular item is selected
    Parameters:
      `rowNum` - row index of the cell to check
      `colNum` - column index of the cell to check
    Returns:
      true == object is selected false == object is not selected
    See Also:
      - `Selection`

  - ### deselectCell

    public Boolean deselectCell(int rowNum, int colNum)
    Deselect a particular cell
    Parameters:
      `rowNum` - row index of the cell to select
      `colNum` - column index of the cell to select
    Returns:
      true == selection actually changed, false == no change
    See Also:
      - `Selection`

  - ### getSelectedRecord

    public ListGridRecord getSelectedRecord()
    Returns the first record that has any cells selected.
    Returns:
      first selected record, or null if nothing selected
    See Also:
      - `Selection`

  - ### selectCell

    public Boolean selectCell(int rowNum, int colNum)
    Select a particular cell
    Parameters:
      `rowNum` - row index of cell to select
      `colNum` - column index of cell to select
    Returns:
      true == selection actually changed, false == no change
    See Also:
      - `Selection`

  - ### selectionChanged

    public void selectionChanged()
    Method called whenever the cell selection is modified
    See Also:
      - `Selection`

  - ### selectSingleCell

    public Boolean selectSingleCell(int rowNum, int colNum)
    select a single cell and deselect everything else
    Parameters:
      `rowNum` - row index of cell to select
      `colNum` - column index of cell to select
    Returns:
      true == selection actually changed, false == no change
    See Also:
      - `Selection`

  - ### 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:
      - `Selection overview and related methods`

  - ### deselectCellList

    public Boolean deselectCellList()
    deselect an array of cells
    Returns:
      true == selection actually changed, false == no change
    See Also:
      - `Selection overview and related methods`

  - ### deselectCellList

    public Boolean deselectCellList(int[][] cells)

  - ### selectCellList

    public Boolean selectCellList()
    select an array of cells
    Returns:
      true == selection actually changed, false == no change
    See Also:
      - `Selection overview and related methods`

  - ### selectCellList

    public Boolean selectCellList(int[][] cells)