Spread.Sheets Documentation
fill Field
Represents the command used to drag and fill a range on the sheet.
* The command has a boolean field canUndo that indicates whether the command supports undo and redo operation, and a method execute that performs an execute operation 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.startRange {GC.Spread.Sheets.Range} The start range.
* options.fillRange {GC.Spread.Sheets.Range} The fill range.
* options.autoFillType {GC.Spread.Sheets.Fill.AutoFillType} The auto fill type.
* options.fillDirection {GC.Spread.Sheets.Fill.FillDirection} The fill direction.
isUndo {boolean} true if an undo operation; otherwise, false.
Syntax
var value; // Type: fill
value = GC.Spread.Sheets.Commands.fill;
var fill : fill;
Example
This example fills a range.
//Add data
for (var col = 1; col < 6; col++) {
    for (var row = 2; row < 11; row++) {
        activeSheet.setValue(row, col, row + col);
    }
}

$("#button1").click(function () {
spread.options.allowUndo = true;
var srange = new GC.Spread.Sheets.Range(10, 5, 1, 1);
var frange = new GC.Spread.Sheets.Range(11, 5, 5, 1);
spread.commandManager().execute({cmd: "fill", sheetName: "Sheet1", startRange: srange, fillRange: frange, autoFillType: GC.Spread.Sheets.Fill.AutoFillType.fillSeries, fillDirection: GC.Spread.Sheets.Fill.FillDirection.down });
});

<input type="button" id="button1" value="button1"/>
This example fills a range with the cell formatting.
activeSheet.getCell(0, 0).backColor("yellow");
activeSheet.getCell(0, 0).value(10);
activeSheet.setValue(0, 2, 15);            
var sourceRange = new GC.Spread.Sheets.Range(0, 0, 1, 1);
var targetRange = new GC.Spread.Sheets.Range(0, 1, 1, 3);
spread.options.allowUndo = true;
spread.commandManager().execute({cmd: "fill", sheetName: "Sheet1", startRange:sourceRange, fillRange: targetRange, autoFillType: GC.Spread.Sheets.Fill.AutoFillType.fillFormattingOnly, fillDirection: GC.Spread.Sheets.Fill.FillDirection.right});
Remarks

dragFillExtent - The drag fill extent information.

startRange {GC.Spread.Sheets.Range} - Indicates the drag fill start range.
fillRange {GC.Spread.Sheets.Range} - Indicates the drag fill end range.
autoFillType {GC.Spread.Sheets.AutoFillType} - Indicates the type of the drag fill.
fillDirection {GC.Spread.Sheets.FillDirection} - Indicates the drag fill direction.

See Also

Reference

Commands type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.