SpreadJS Documentation
Adding and Deleting Outlines
SpreadJS Documentation > Sample Code > Sample Code for Range Grouping > Adding and Deleting Outlines

You can add and delete outlines in range grouping.

Using Code

This example adds and deletes outlines.

JavaScript
Copy Code
$("#button1").click(function () {
    var activeSheet = spread.getActiveSheet();

    activeSheet.suspendPaint();
    //Set Outline of row
    activeSheet.rowOutlines.group(0, 4);
    activeSheet.rowOutlines.group(0, 1);
    activeSheet.rowOutlines.group(2, 1);

    //Set Outline of column
    activeSheet.columnOutlines.group(0, 4);
    activeSheet.columnOutlines.group(0, 1);
    activeSheet.columnOutlines.group(2, 1);
    activeSheet.resumePaint();
});

$("#button2").click(function(){
    var activeSheet = spread.getActiveSheet();

    activeSheet.suspendPaint();
    //Remove Outline of row
    activeSheet.rowOutlines.ungroupRange(0, 4);
    activeSheet.rowOutlines.ungroupRange(0, 1);
    activeSheet.rowOutlines.ungroupRange(2, 1);

    //Remove Outline of column
    activeSheet.columnOutlines.ungroupRange(0, 4);
    activeSheet.columnOutlines.ungroupRange(0, 1);
    activeSheet.columnOutlines.ungroupRange(2, 1);
    activeSheet.resumePaint();
});
See Also

Developer's Guide