SpreadJS 14
GC.Spread.Sheets Namespace / Worksheet type / setSelection Method
The row index of the first cell to add.
The column index of the first cell to add.
The number of rows to add.
The number of columns to add.
In This Topic
    setSelection Method
    In This Topic
    Sets the selection to a cell or a range and sets the active cell to the first cell.
    Syntax
    var instance = new GC.Spread.Sheets.Worksheet(name);
    var value; // Type: any
    value = instance.setSelection(row, column, rowCount, columnCount);
    function setSelection( 
       row : number,
       column : number,
       rowCount : number,
       columnCount : number
    ) : any;

    Parameters

    row
    The row index of the first cell to add.
    column
    The column index of the first cell to add.
    rowCount
    The number of rows to add.
    columnCount
    The number of columns to add.
    Example
    This example selects a range of cells.
    sheet.setValue(0,0, 1,3);
    sheet.setValue(1,0, 50,3);
    sheet.setValue(2,0, 100,3);
    sheet.setValue(3,0, 2,3);
    sheet.setValue(4,0, 60,3);
    sheet.setValue(5,0, 90,3);
    sheet.setValue(6,0, 3,3);
    sheet.setValue(7,0, 40,3);
    sheet.setValue(8,0, 70,3);
    sheet.setValue(9,0, 5,3);
    sheet.setValue(10,0, 35,3);
    sheet.setSelection(0,0,11,1);
    sheet.conditionalFormats.add3ScaleRule(1, 10, "red", 0, 50, "blue",2, 100, "yellow", sheet.getSelections());
    
    See Also

    Reference

    Worksheet type