SpreadJS Documentation
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 = $("#ss").data("spread").getActiveSheet();

    activeSheet.isPaintSuspended(true);

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

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

    activeSheet.isPaintSuspended(false);
});

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

    activeSheet.isPaintSuspended(true);

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

    //Remove Outline of column
    activeSheet.colRangeGroup.ungroupRange(0, 4);
    activeSheet.colRangeGroup.ungroupRange(0, 1);
    activeSheet.colRangeGroup.ungroupRange(2, 1);

    activeSheet.isPaintSuspended(false);
});
See Also

Developer's Guide

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.