SpreadJS Documentation
GC.Spread.Sheets Namespace / Worksheet type / deleteRows Method
The index of the first row to delete.
The number of rows to delete.
In This Topic
    deleteRows Method
    In This Topic
    Deletes the rows in this worksheet at the specified index.
    Syntax
    var instance = new GC.Spread.Sheets.Worksheet(name);
    var value; // Type: any
    value = instance.deleteRows(row, count);
    function deleteRows( 
       row : number,
       count : number
    ) : any;

    Parameters

    row
    The index of the first row to delete.
    count
    The number of rows to delete.
    Example
    This example uses the deleteRows method.
    // Set the number of rows to 3.
        activeSheet.setRowCount(3, GC.Spread.Sheets.SheetArea.viewport);
        activeSheet.setValue(0, 0, "The 1st row", GC.Spread.Sheets.SheetArea.viewport);
        activeSheet.setValue(1, 0, "The 2st row", GC.Spread.Sheets.SheetArea.viewport);
        activeSheet.setValue(2, 0, "The 3st row", GC.Spread.Sheets.SheetArea.viewport);
        activeSheet.setColumnWidth(0, 90.0, GC.Spread.Sheets.SheetArea.viewport);
    
        $("#button1").click(function(){
            //Delete Row 2.
    activeSheet.deleteRows(1, 1);
        });
    
        $("#button2").click(function(){
            //Delete Column 2.
     activeSheet.deleteColumns(1, 1);
        });
    
    //Add button controls to page
    <input type="button" id="button1" value="button1"/>
    <input type="button" id="button2" value="button2"/>
    activeSheet.getCell(0,0).value("A1");
    activeSheet.getCell(0,4).value("Test")
    activeSheet.deleteColumns(0,2);
    activeSheet.deleteRows(3,1);
    See Also

    Reference

    Worksheet type