Spread.Sheets Documentation
autoFitRow Field
Represents the command used to automatically resize the row in a sheet.
* The command has a boolean field canUndo that indicates whether the command supports undo and redo operations, and an execute method that performs an execute or undo operation.
* The arguments of the execute method are as follows.
context {GC.Spread.Sheets.Workbook} The context of the operation.
options {Object} The options of the operation.
* options.sheetName {string} The sheet name.
* options.rows {Array} The resize rows; each item is an object which has a row.
* options.columnHeader {boolean} Whether the resized rows are in the column header area.
* options.autoFitType {GC.Spread.Sheets.AutoFitType} Whether the auto-fit action includes the header text.
isUndo {boolean} true if this is an undo operation; otherwise, false.
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

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.