SpreadJS 13
GC.Spread.Sheets Namespace / Commands type / autoFitRow Field
In This Topic
    autoFitRow Field
    In This Topic
    Represents the command used to automatically resize the row in a sheet.
    Syntax
    var value; // Type: autoFitRow
    value = GC.Spread.Sheets.Commands.autoFitRow;
    var autoFitRow : autoFitRow;
    Example
    This example automatically resizes a row.
    //Add data
    for (var col = 1; col < 6; col++) {
        for (var row = 2; row < 11; row++) {
            activeSheet.setValue(row, col, row + col);
        }
    }
    activeSheet.setRowHeight(3, 90.0,GC.Spread.Sheets.SheetArea.viewport);
    
    $("#button1").click(function () {
    spread.options.allowUndo = true;
    var rows = [ { row: 3 } ];
    spread.commandManager().execute({cmd: "autoFitRow", sheetName: "Sheet1", rows: rows, isColHeader: false, autoFitType: GC.Spread.Sheets.AutoFitType.cell});
        });
    
    <input type="button" id="button1" value="button1"/>
    See Also

    Reference

    Commands type