SpreadJS Documentation
deleteRows Method
The index of the first row to delete.
The number of rows to delete.
Deletes the rows in this sheet at the specified index.
Syntax
var instance = new GcSpread.Sheets.Sheet(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, GcSpread.Sheets.SheetArea.viewport);
    activeSheet.setValue(0, 0, "The 1st row", GcSpread.Sheets.SheetArea.viewport);
    activeSheet.setValue(1, 0, "The 2st row", GcSpread.Sheets.SheetArea.viewport);
    activeSheet.setValue(2, 0, "The 3st row", GcSpread.Sheets.SheetArea.viewport);
    activeSheet.setColumnWidth(0, 90.0, GcSpread.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

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.