SpreadJS Documentation
deleteColumns Method
GC.Spread.Sheets Namespace > Worksheet type : deleteColumns Method
The index of the first column to delete.
The number of columns to delete.
Deletes the columns in this sheet at the specified index.
Syntax
var instance = new GC.Spread.Sheets.Worksheet(name);
var value; // Type: any
value = instance.deleteColumns(col, count);
function deleteColumns( 
   col : number,
   count : number
) : any;

Parameters

col
The index of the first column to delete.
count
The number of columns to delete.
Example
This example uses the deleteColumns 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