SpreadJS 13
GC.Spread.Sheets Namespace / Worksheet type / getValue Method
The row index.
The column index.
The sheet area. If this parameter is not provided, it defaults to viewport.
Indicate the return value type is normal text or rich text, default is normal text.
In This Topic
    getValue Method
    In This Topic
    Gets the unformatted data from the specified cell in the specified sheet area.
    Syntax
    var instance = new GC.Spread.Sheets.Worksheet(name);
    var value; // Type: Object
    value = instance.getValue(row, col, sheetArea, valueType);
    function getValue( 
       row : number,
       col : number,
       (optional) sheetArea : SheetArea,
       (optional) valueType : ValueType
    ) : Object;

    Parameters

    row
    The row index.
    col
    The column index.
    sheetArea
    The sheet area. If this parameter is not provided, it defaults to viewport.
    valueType
    Indicate the return value type is normal text or rich text, default is normal text.

    Return Value

    Returns the value of the cell.
    Example
    This example uses the getValue method.
    //Set values to Text property
    activeSheet.getCell(0, 0).text("10");
    //Set values by calling SetText method
    activeSheet.setText(1, 0, "10");
    //Set values to Value property.
    activeSheet.getCell(0, 1).value(10);
    //Set values by calling SetValue method.
    activeSheet.setValue(1, 1, 10);
    
        $("#button1").click(function(){
            alert("Obtaining cell values by referring to Text property: " + activeSheet.getCell(0, 0).text() + "\n" +
                "Obtaining cell values by calling GetText method: " + activeSheet.getText(1, 0) + "\n" +
                "Obtaining cell values by referring to Value property: " + activeSheet.getCell(0, 1).value() + "\n" +
                "Obtaining cell values by calling GetValue method: " + activeSheet.getValue(1, 1));
    });
    
    //Add button control to page
    <input type="button" id="button1" value="button1"/>
    See Also

    Reference

    Worksheet type