SpreadJS 13
GC.Spread.Sheets Namespace / Worksheet type / getSpans Method
The cell range.
The sheet area. If this parameter is not given, it defaults to viewport.
In This Topic
    getSpans Method
    In This Topic
    Gets the spans in the specified range in the specified sheet area.
    Syntax
    var instance = new GC.Spread.Sheets.Worksheet(name);
    var value; // Type: any
    value = instance.getSpans(range, sheetArea);
    function getSpans( 
       range : Range,
       (optional) sheetArea : SheetArea
    ) : any;

    Parameters

    range
    The cell range.
    sheetArea
    The sheet area. If this parameter is not given, it defaults to viewport.

    Return Value

    An array that contains span information whose item type is GC.Spread.Sheets.Range.
    Example
    This example gets the cell spans.
    activeSheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport);
    
    //button click event
    var spans= activeSheet.getSpans();      
    for(var i = 0; i < spans.length; i++){
    alert(spans[i].row);
    alert(spans[i].rowCount);
    alert(spans[i].col);
    alert(spans[i].colCount);
    }
    This example displays alerts.
    sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport);
    var spans =sheet.getSpans();
    for(var i=0;i<spans.length;i++) {
      alert(spans[i].row.toString() + spans[i].col.toString());
     }
    See Also

    Reference

    Worksheet type