[]
        
(Showing Draft Content)

GC.Spread.Sheets.Events

Class: Events

Spread.Sheets.Events

Table of contents

Constructors

Events

Constructors

constructor

new Events()

Defines the events supported in SpreadJS.

Events

ActiveSheetChanged

Static ActiveSheetChanged: string

Occurs when the user has changed the active sheet.

name GC.Spread.Sheets.Workbook#ActiveSheetChanged

param The old sheet.

param The new sheet.

example

//This example creates log text for the ActiveSheetChanged event.
// Use IE to see the console log text
spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanged, function (sender, args) {
    console.log("Active sheet has been switched.");
});

ActiveSheetChanging

Static ActiveSheetChanging: string

Occurs when the user is changing the active sheet.

name GC.Spread.Sheets.Workbook#ActiveSheetChanging

param The old sheet.

param The new sheet.

param A value that indicates whether the operation should be canceled.

example

//This example stops the active sheet from changing.
spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanging, function (sender, args) {
    //Cancel sheet switching.
    args.cancel = true;
});

BeforePrint

Static BeforePrint: string

Occurs before the print

name GC.Spread.Sheets.WorkBook.BeforePrint

param The print Dom

param Whether cancel print

example

//This example uses the BeforePrint.
window.onload = function(){
     var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
     spread.bind(GC.Spread.Sheets.Events.BeforePrint, function (e, data) {
         alert(data.iframe + '\n' + 'cancel: ' + data.cancel);
     });
}

ButtonClicked

Static ButtonClicked: string

Occurs when the user clicks a button, check box, or hyperlink in a cell.

name GC.Spread.Sheets.Workbook#ButtonClicked

param The sheet that triggered the event.

param The sheet's name.

param The row index of the cell.

param The column index of the cell.

param The sheet area that contains the cell.

example

//This example creates a button cell.
var cellType = new GC.Spread.Sheets.CellTypes.Button();
cellType.buttonBackColor("#FFFF00");
cellType.text("this is a button");
activeSheet.setCellType(1,1,cellType);
//bind
spread.bind(GC.Spread.Sheets.Events.ButtonClicked, function (e, args) {
    var sheet = args.sheet, row = args.row, col = args.col;
    var cellType = activeSheet.getCellType(row, col);
    if (cellType instanceof GC.Spread.Sheets.CellTypes.Button) {
        alert("Button Clicked");
    }
});

CellChanged

Static CellChanged: string

Occurs when a change is made to a cell in this sheet that may require the cell to be repainted.

name GC.Spread.Sheets.Worksheet#CellChanged

param The sheet that triggered the event.

param The sheet's name.

param The row index of the cell.

param The column index of the cell.

param The sheetArea of the cell.

param The name of the cell's property that has changed.

param Whether this event is from a undo operation.

example

//This example uses the CellChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (e, info) {
    if(info.sheetArea === GC.Spread.Sheets.SheetArea.viewport){
        alert("Cell index (" + info.row + "," + info.col + ")");
    }
});

CellClick

Static CellClick: string

Occurs when the user presses down the left mouse button in a cell.

name GC.Spread.Sheets.Worksheet#CellClick

param The sheet that triggered the event.

param The sheet's name.

param The sheet area the clicked cell is in.

param The row index of the clicked cell.

param The column index of the clicked cell.

example

//This example uses the CellClick event.
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) {
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){
        console.log("The column header was clicked.");
    }
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){
        console.log("The row header was clicked.");
    }
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){
        console.log("The corner header was clicked.");
    }
    console.log("Clicked column index: " + args.col);
    console.log("Clicked row index: " + args.row);
});
//bind
activeSheet.bind(GC.Spread.Sheets.Events.CellDoubleClick, function (sender, args) {
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){
        console.log("The column header was double clicked.");
   }
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){
        console.log("The row header was double clicked.");
    }
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){
        console.log("The corner header was double clicked.");
    }
    console.log("Double clicked column index: " + args.col);
    console.log("Double clicked row index: " + args.row);
})

CellDoubleClick

Static CellDoubleClick: string

Occurs when the user presses down the left mouse button twice (double-clicks) in a cell.

name GC.Spread.Sheets.Worksheet#CellDoubleClick

param The sheet that triggered the event.

param The sheet's name.

param The sheet area the clicked cell is in.

param The row index of the clicked cell.

param The column index of the clicked cell.

example

//This example uses the CellDoubleClick event.
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) {
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){
        console.log("The column header was clicked.");
    }
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){
        console.log("The row header was clicked.");
    }
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){
        console.log("The corner header was clicked.");
    }
    console.log("Clicked column index: " + args.col);
    console.log("Clicked row index: " + args.row);
});
//bind
activeSheet.bind(GC.Spread.Sheets.Events.CellDoubleClick, function (sender, args) {
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){
        console.log("The column header was double clicked.");
    }
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){
        console.log("The row header was double clicked.");
    }
    if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){
        console.log("The corner header was double clicked.");
    }
    console.log("Double clicked column index: " + args.col);
    console.log("Double clicked row index: " + args.row);
});

ClipboardChanged

Static ClipboardChanged: string

Occurs when a Clipboard change occurs that affects Spread.Sheets.

name GC.Spread.Sheets.Worksheet#ClipboardChanged

param The sheet that triggered the event.

param The sheet's name.

param The data from Spread.Sheets that has been set into the clipboard.

param The text string of the clipboard.

param The html string of the clipboard.

param The copied floating objects, it contains picture, custom floating object, slicer, chart and shape.

example

//This example uses the ClipboardChanged event.
// Use IE to see the console log text
var activeSheet = spread.getActiveSheet();
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardChanged, function (sender, args) {
    console.log("ClipboardChanged.");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardChanging, function (sender, args) {
    console.log("ClipboardChanging");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (sender, args) {
    console.log("ClipboardPasted");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasting, function (sender, args) {
    console.log("ClipboardPasting");
});

ClipboardChanging

Static ClipboardChanging: string

Occurs when the Clipboard is changing due to a Spread.Sheets action.

name GC.Spread.Sheets.Worksheet#ClipboardChanging

param The sheet that triggered the event.

param The sheet's name.

param The data from Spread.Sheets that is set into the clipboard.

param The text string of the clipboard.

param The html string of the clipboard.

param The source ranges of the source sheet for current cut or copy operation.

param Indicates current operation is cut or copy.

param The coping floating objects, it contains picture, custom floating object, slicer, chart and shape.

param A value that indicates whether the operation should be canceled.

example

//This example uses the ClipboardChanging event.
// Use IE to see the console log text
var activeSheet = spread.getActiveSheet();
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardChanged, function (sender, args) {
    console.log("ClipboardChanged.");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardChanging, function (sender, args) {
    console.log("ClipboardChanging");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (sender, args) {
    console.log("ClipboardPasted");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasting, function (sender, args) {
    console.log("ClipboardPasting");
});

ClipboardPasted

Static ClipboardPasted: string

Occurs when the user pastes from the Clipboard.

name GC.Spread.Sheets.Worksheet#ClipboardPasted

param The sheet that triggered the event.

param The sheet's name.

param The range that was pasted.

param The paste option that indicates what data is pasted from the clipboard: values, formatting, or formulas.

param The data from the clipboard that will be pasted into Spread.Sheets.

param The text string of the clipboard.

param The html string of the clipboard.

param The image src string of the clipboard.

param the source sheet of data range.

param The source range of paste when copy or cut range.

param A value that indicates whether the operation is cutting.

param The pasted floating objects, it contains picture, custom floating object, slicer, chart and shape.

param The shift cells option, if not shift cell, will be undefined.

example

//This example uses the ClipboardPasted event.
// Use IE to see the console log text
var activeSheet = spread.getActiveSheet();
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardChanged, function (sender, args) {
    console.log("ClipboardChanged.");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardChanging, function (sender, args) {
    console.log("ClipboardChanging");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (sender, args) {
    console.log("ClipboardPasted");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasting, function (sender, args) {
    console.log("ClipboardPasting");
});

ClipboardPasting

Static ClipboardPasting: string

Occurs when the user is pasting from the Clipboard.

name GC.Spread.Sheets.Worksheet#ClipboardPasting

param The sheet that triggered the event.

param The sheet's name.

param The range to paste.

param The paste option that indicates what data is pasted from the clipboard: values, formatting, or formulas.

param The data from the clipboard that will be pasted into Spread.Sheets.

param The text string of the clipboard.

param The html string of the clipboard.

param The image src string of the clipboard.

param the source sheet of data range.

param The source range of paste when copy or cut range.

param A value that indicates whether the operation is cutting.

param The pasting floating objects, it contains picture, custom floating object, slicer, chart and shape.

param A value that indicates whether the operation should be canceled.

param The shift cells option, if not shift cell, will be undefined.

example

//This example uses the ClipboardPasting event.
// Use IE to see the console log text
var activeSheet = spread.getActiveSheet();
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardChanged, function (sender, args) {
    console.log("ClipboardChanged.");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardChanging, function (sender, args) {
    console.log("ClipboardChanging");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (sender, args) {
    console.log("ClipboardPasted");
});
activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasting, function (sender, args) {
    console.log("ClipboardPasting");
});

ColumnChanged

Static ColumnChanged: string

Occurs when a change is made to a column or range of columns in this sheet that may require the column or range of columns to be repainted.

name GC.Spread.Sheets.Worksheet#ColumnChanged

param The sheet that triggered the event.

param The sheet's name.

param The column index.

param The sheetArea of the column.

param The name of the column's property that has changed.

param Whether this event is from a undo operation.

example

//This example uses the ColumnChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.ColumnChanged, function (e, info) {
    if(info.sheetArea === GC.Spread.Sheets.SheetArea.viewport){
        alert("Index (" + info.col + ")");
    }
});

ColumnChanging

Static ColumnChanging: string

Occurs when before a change is made to a column or range of columns in this sheet that may require the column or range of columns to be repainted.

name GC.Spread.Sheets.Worksheet#ColumnChanging

param The sheet that triggered the event.

param The sheet's name.

param The column index.

param The sheetArea of the column.

param The name of the column's property that has changed.

example

//This example uses the ColumnChanging event.
activeSheet.bind(GC.Spread.Sheets.Events.ColumnChanging, function (e, info) {
    if(info.sheetArea === GC.Spread.Sheets.SheetArea.viewport){
        alert("Index (" + info.col + ")");
    }
});

ColumnWidthChanged

Static ColumnWidthChanged: string

Occurs when the column width has changed.

name GC.Spread.Sheets.Worksheet#ColumnWidthChanged

param The sheet that triggered the event.

param The sheet's name.

param The list of columns whose widths have changed.

param Whether the columns are row header columns.

example

//This example uses the ColumnWidthChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.ColumnWidthChanged, function (e, info) {
        alert("Column (" + info.colList + ")");
});

ColumnWidthChanging

Static ColumnWidthChanging: string

Occurs when the column width is changing.

name GC.Spread.Sheets.Worksheet#ColumnWidthChanging

param The sheet that triggered the event.

param The sheet's name.

param The list of columns whose widths are changing.

param Whether the columns are row header columns.

param A value that indicates whether the operation should be canceled.

example

//This example uses the ColumnWidthChanging event.
activeSheet.bind(GC.Spread.Sheets.Events.ColumnWidthChanging, function (e, info) {
        alert("Column (" + info.colList + ")");
});

CommentChanged

Static CommentChanged: string

Occurs when any comment has changed.

name GC.Spread.Sheets.Worksheet#CommentChanged

param The sheet that triggered the event.

param The sheet's name.

param The comment that triggered the event.

param The name of the comment's property that has changed.

example

//This example uses the CommentChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.CommentChanged, function (e, info) {
    alert("changed");
});

CommentRemoved

Static CommentRemoved: string

Occurs when the user has removed the comment.

name GC.Spread.Sheets.Worksheet#CommentRemoved

param The sheet that triggered the event.

param The sheet's name.

param The comment has been removed.

example

//This example uses the CommentRemoved event.
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("orange");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.getCell(5,5).comment(comment);
activeSheet.bind(GC.Spread.Sheets.Events.CommentRemoved, function (e, info) {
       console.log("sheet name: " + info.sheetName);
});

CommentRemoving

Static CommentRemoving: string

Occurs when the user is removing any comment.

name GC.Spread.Sheets.Worksheet#CommentRemoving

param The sheet that triggered the event.

param The sheet's name.

param The comment is being removed.

param A value that indicates whether the operation should be canceled.

example

//This example prevents the comment from being removed.
var comment = new GC.Spread.Sheets.Comments.Comment();
comment.text("new comment!");
comment.backColor("orange");
comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown);
activeSheet.getCell(5,5).comment(comment);
activeSheet.bind(GC.Spread.Sheets.Events.CommentRemoving, function (e, info) {
      info.cancel = true;
});

DragDropBlock

Static DragDropBlock: string

Occurs when the user is dragging and dropping a range of cells.

name GC.Spread.Sheets.Worksheet#DragDropBlock

param The sheet that triggered the event.

param The sheet's name.

param The row index of the top left cell of the source range (range being dragged).

param The column index of the top left cell of the source range (range being dragged).

param The row index of the top left cell of the destination range (where selection is dropped).

param The column index of the bottom right cell of the destination range (where selection is dropped).

param The row count of the cell range being dragged.

param The column count of the cell range being dragged.

param Whether the source range is copied.

param Whether the source range is inserted.

param The CopyOption value for the drag and drop operation.

param A value that indicates whether the operation should be canceled.

example

//This example creates log text for the DragDropBlock event.
// Use IE to see the console log text
var activeSheet = spread.getActiveSheet();
activeSheet.bind(GC.Spread.Sheets.Events.DragDropBlock, function (e, args) {
        console.log("From Column:" + args.fromCol);
        console.log("From Row:" + args.fromRow);
        console.log("To Column:" + args.toCol);
        console.log("To Row:" + args.toRow);
    });

DragDropBlockCompleted

Static DragDropBlockCompleted: string

Occurs when the user completes dragging and dropping a range of cells.

name GC.Spread.Sheets.Worksheet#DragDropBlockCompleted

param The sheet that triggered the event.

param The sheet's name.

param The row index of the top left cell of the source range (range being dragged).

param The column index of the top left cell of the source range (range being dragged).

param The row index of the top left cell of the destination range (where selection is dropped).

param The column index of the bottom right cell of the destination range (where selection is dropped).

param The row count of the cell range being dragged.

param The column count of the cell range being dragged.

param Whether the source range is copied.

param Whether the source range is inserted.

param The CopyOption value for the drag and drop operation.

example

//This example uses the DragDropBlockCompleted event.
activeSheet.bind(GC.Spread.Sheets.Events.DragDropBlockCompleted, function (e, args) {
        alert("From Column (" + args.fromCol + ")");
});

DragFillBlock

Static DragFillBlock: string

Occurs when the user is dragging to fill a range of cells.

name GC.Spread.Sheets.Worksheet#DragFillBlock

param The sheet that triggered the event.

param The sheet's name.

param The range used for the fill operation.

param AutoFillType value used for the fill operation.

param The direction of the fill.

param A value that indicates whether the operation should be canceled.

example

//This example uses the DragFillBlock event.
activeSheet.bind(GC.Spread.Sheets.Events.DragFillBlock, function (e, info) {
        alert("Direction (" + info.fillDirection + ")");
});

DragFillBlockCompleted

Static DragFillBlockCompleted: string

Occurs when the user completes dragging to fill a range of cells.

name GC.Spread.Sheets.Worksheet#DragFillBlockCompleted

param The sheet that triggered the event.

param The sheet's name.

param The range used for the fill operation.

param AutoFillType value used for the fill operation.

param The direction of the fill.

example

//This example uses the DragFillBlockCompleted event.
activeSheet.bind(GC.Spread.Sheets.Events.DragFillBlockCompleted, function (e, info) {
        alert("Type (" + info.autoFillType + ")");
});

DragMerged

Static DragMerged: string

Occurs after user drag merge cells.

name GC.Spread.Sheets.Worksheet#DragMerged

param The sheet that triggered the event.

param The sheet's name.

param The range that will be merged.

example

//This example returns the row index.
// Press Ctrl key to merge
$(document).keydown(function (e) {
     if (e.keyCode === 17) {
        spread.options.allowUserDragMerge = true;
     }
});
$(document).keyup(function (e) {
     if (e.keyCode === 17) {
        spread.options.allowUserDragMerge = false;
     }
});
activeSheet.bind(GC.Spread.Sheets.Events.DragMerging, function (e, data) {
     var mergeRange = data.mergeRange;
     alert(mergeRange.row);
});
activeSheet.bind(GC.Spread.Sheets.Events.DragMerged, function (e, data) {
     var mergeRange = data.mergeRange;
     alert(mergeRange.row);
});

DragMerging

Static DragMerging: string

Occurs before user drag merge cells.

name GC.Spread.Sheets.Worksheet#DragMerging

param The sheet that triggered the event.

param The sheet's name.

param The range that will be merged.

param A value that indicates whether the operation should be canceled.

example

//This example returns the row index.
// Press Ctrl key to merge
$(document).keydown(function (e) {
     if (e.keyCode === 17) {
         spread.options.allowUserDragMerge = true;
     }
});
$(document).keyup(function (e) {
     if (e.keyCode === 17) {
         spread.options.allowUserDragMerge = false;
     }
});
activeSheet.bind(GC.Spread.Sheets.Events.DragMerging, function (e, data) {
     var mergeRange = data.mergeRange;
     alert(mergeRange.row);
});
activeSheet.bind(GC.Spread.Sheets.Events.DragMerged, function (e, data) {
     var mergeRange = data.mergeRange;
     alert(mergeRange.row);
});

EditChange

Static EditChange: string

Occurs when a cell is in edit mode and the text is changed.

name GC.Spread.Sheets.Worksheet#EditChange

param The sheet that triggered the event.

param The sheet's name.

param The row index of cell.

param The column index of cell.

param The value from the current editor.

example

//This example creates log text for the EditChange event.
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.EditChange, function (sender, args) {
    console.log("Cell (" + args.row + ", " + args.col + ") data has been changed.")
});

EditEnded

Static EditEnded: string

Occurs when a cell leaves edit mode.

name GC.Spread.Sheets.Worksheet#EditEnded

param The sheet that triggered the event.

param The sheet's name.

param The row index of cell.

param The column index of cell.

param The value from the current editor.

example

//This example creates log text for the EditStarting and EditEnded events.
 // Use IE to see the console log text
var activeSheet = spread.getActiveSheet();
activeSheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
    console.log("Start cell editing.");
});
activeSheet.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, args) {
    console.log("Finish cell editing.");
});

EditEnding

Static EditEnding: string

Occurs when a cell is leaving edit mode.

name GC.Spread.Sheets.Worksheet#EditEnding

param The sheet that triggered the event.

param The sheet's name.

param The row index of cell.

param The column index of cell.

param The current editor.

param The value from the current editor.

param A value that indicates whether the operation should be canceled.

example

//This example uses the EditEnding event.
activeSheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
    console.log("Start cell editing.");
});
activeSheet.bind(GC.Spread.Sheets.Events.EditEnding, function (sender, args) {
    console.log("EditEnding event.");
});
activeSheet.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, args) {
    console.log("EditEnded event.");
});

EditStarting

Static EditStarting: string

Occurs when a cell is entering edit mode.

name GC.Spread.Sheets.Worksheet#EditStarting

param The sheet that triggered the event.

param The sheet's name.

param The row index of cell.

param The column index of cell.

param A value that indicates whether the operation should be canceled.

example

//This example creates log text for the EditStarting and EditEnded events.
// Use IE to see the console log text
var activeSheet = spread.getActiveSheet();
activeSheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
    console.log("Start cell editing.");
});
activeSheet.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, args) {
    console.log("Finish cell editing.");
});

EditorStatusChanged

Static EditorStatusChanged: string

Occurs when the editor's status has changed.

name GC.Spread.Sheets.Worksheet#EditorStatusChanged

param The sheet that triggered the event.

param The sheet's name.

param The old status of the editor.

param The new status of the editor.

example

//This example uses the EditorStatusChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.EditorStatusChanged, function (e, info) {
        alert("Column (" + info.newStatus + ")");
});

EnterCell

Static EnterCell: string

Occurs when the focus enters a cell.

name GC.Spread.Sheets.Worksheet#EnterCell

param The sheet that triggered the event.

param The sheet's name.

param The row index of the cell being entered.

param The column index of the cell being entered.

example

//This example uses the EnterCell event.
activeSheet.bind(GC.Spread.Sheets.Events.EnterCell, function (e, info) {
        alert("Cell (" + info.row + ", " + info.col +")");
});

FloatingObjectChanged

Static FloatingObjectChanged: string

Occurs when any floating object has changed.

name GC.Spread.Sheets.Worksheet#FloatingObjectsChanged

param The sheet that triggered the event.

param The sheet's name.

param The floating object that triggered the event.

param The name of the floating object's property that has changed.

example

//This example uses the FloatingObjectChanged event.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectChanged, function (e, info) {
       alert("changed");
});

FloatingObjectLoaded

Static FloatingObjectLoaded: string

Occurs when the custom floating object content is loaded.

name GC.Spread.Sheets.Worksheet#FloatingObjectLoaded

param The sheet that triggered the event.

param The sheet's name.

param The custom floating object that triggered the event.

param The HTMLElement of the custom floating object.


FloatingObjectRemoved

Static FloatingObjectRemoved: string

Occurs when the user has removed the floating object.

name GC.Spread.Sheets.Worksheet#FloatingObjectRemoved

param The sheet that triggered the event.

param The sheet's name.

param The floating object has been removed.

example

//This example uses the FloatingObjectRemoved event.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectRemoved, function (e, info) {
        alert(info.sheetName);
});

FloatingObjectRemoving

Static FloatingObjectRemoving: string

Occurs when the user is removing any floating object.

name GC.Spread.Sheets.Worksheet#FloatingObjectRemoving

param The sheet that triggered the event.

param The sheet's name.

param The floating object is being removed.

param A value that indicates whether the operation should be canceled.

example

//This example uses the FloatingObjectRemoving event.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectRemoving, function (e, info) {
        info.cancel = true;
});

FloatingObjectSelectionChanged

Static FloatingObjectSelectionChanged: string

Occurs when the selections of the floating object have changed.

name GC.Spread.Sheets.Worksheet#FloatingObjectsSelectionChanged

param The sheet that triggered the event.

param The sheet's name.

param The floating object that triggered the event.

example

//This example uses the FloatingObjectSelectionChanged event.
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64);
var btn = document.createElement('button');
btn.style.width = "60px";
btn.style.height = "30px";
btn.innerText = "button";
customFloatingObject.content(btn);
activeSheet.floatingObjects.add(customFloatingObject);
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectSelectionChanged, function (e, info) {
       console.log("sheet name: " + info.sheetName);
});

InvalidOperation

Static InvalidOperation: string

Occurs when an invalid operation is performed.

name GC.Spread.Sheets.Worksheet#InvalidOperation

param The sheet that triggered the event.

param The sheet's name.

param Indicates which operation was invalid.

param The description of the invalid operation.

param When invalidType is dragFill, The range used for the fill operation.

example

//This example uses the InvalidOperation event.
activeSheet.bind(GC.Spread.Sheets.Events.InvalidOperation, function (e, info) {
        alert("Message (" + info.message + ")");
});

LeaveCell

Static LeaveCell: string

Occurs when the focus leaves a cell.

name GC.Spread.Sheets.Worksheet#LeaveCell

param The sheet that triggered the event.

param The sheet's name.

param The row index of the cell being left.

param The column index of the cell being left.

param Whether the operation should be canceled.

example

//This example creates log text for the LeaveCell event.
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.LeaveCell, function (sender, args) {
    console.log("The column index before moving: " + args.col);
    console.log("The row index before moving: " + args.row);
});

LeftColumnChanged

Static LeftColumnChanged: string

Occurs when the left column changes.

name GC.Spread.Sheets.Worksheet#LeftColumnChanged

param The sheet that triggered the event.

param The sheet's name.

param The old left column index.

param The new left column index.

example

//This example synchronizes vertical and horizontal scrolling for sheet 1 and sheet 2.
var sheet1 = spread.getSheet(0),
sheet2 = spread.getSheet(1);
sheet1.bind(GC.Spread.Sheets.Events.TopRowChanged, function (sender, args) {
    //Set the displayed top row of sheet1 to sheet2 (vertical scroll synchronization).
    sheet2.showRow(args.newTopRow, GC.Spread.Sheets.VerticalPosition.top);
});
sheet1.bind(GC.Spread.Sheets.Events.LeftColumnChanged, function (sender, args) {
    //Set the displayed left column of sheet1 to sheet2 (Horizontal scroll synchronization).
    sheet2.showColumn(args.newLeftCol, GC.Spread.Sheets.HorizontalPosition.left);
});

OutlineColumnCheckStatusChanged

Static OutlineColumnCheckStatusChanged: string

Occurs when the outline column check status has changed.

name GC.Spread.Sheets.Worksheet#OutlineColumnCheckStatusChanged

param The sheet that triggered the event.

param The sheet's name.

param The outline column's change row index.

param The outline column's change col index.

param The outline column's change status

example

//Removing the sparkline causes a change.
activeSheet.bind(GC.Spread.Sheets.Events.OutlineColumnCheckStatusChanged, function (e, info) {
     console.log("status: " + info.status);
});

PictureChanged

Static PictureChanged: string

Occurs when any picture has changed.

name GC.Spread.Sheets.Worksheet#PictureChanged

param The sheet that triggered the event.

param The sheet's name.

param The picture that triggered the event.

param The name of the picture's property that has changed.

example

var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
var activeSheet = spread.getActiveSheet();
activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.PictureChanged, function (e, info) {
console.log("Sheet: " + info.sheetName);
});

example

var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
var activeSheet = spread.getActiveSheet();
activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.PictureChanged, function (e, info) {
console.log("Property: " + info.propertyName);
});

PictureSelectionChanged

Static PictureSelectionChanged: string

Occurs when the selections of the picture have changed.

name GC.Spread.Sheets.Worksheet#PictureSelectionChanged

param The sheet that triggered the event.

param The sheet's name.

param The picture that triggered the event.

example

//This example uses the PictureSelectionChanged event.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
var activeSheet = spread.getActiveSheet();
activeSheet.pictures.add("f2","Event.png",2,2,6,6);
activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6);
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.PictureSelectionChanged, function (e, info) {
console.log("Sheet: " + info.sheetName);
});

PivotTableChanged

Static PivotTableChanged: string

After PivotTable filter/sort/collapse/fieldChanged.

name GC.Spread.Sheets.Worksheet#PivotTableChanged

param The PivotTable's name.

param The specific operation name("filter" | "sort" | "collapse" | "fieldChanged" | "summarizedValueBy" | "showValueAs" | "dataPositionChanged" | "viewChanged").

param Changed fieldName.

param PivotTable changes the value of the previous attribute(collapse, summarizedValueBy, showValueAs).

param PivotTable changes the value of the previous attribute(collapse, summarizedValueBy, showValueAs).

param PivotTable sort changes the value of the attribute(sort).

param PivotTable filter changes the value of the attribute(filter).

param PivotTable clear filter changes the value of the attribute(filter).

param Old PivotTable Field Type(fieldChanged).

param Old PivotTable Field index(fieldChanged).

param New PivotTable Field Type(fieldChanged).

param New PivotTable Field index(fieldChanged).

param Apply PivotTable Views Name(viewChanged).

example

//This example.
sheet.bind(GC.Spread.Sheets.Events.PivotTableChanged, function (sender, args) {
    alert("pivotTableName: " + args.pivotTableName + "changeType: " + args.type);
});

RangeChanged

Static RangeChanged: string

Occurs when the cell range has changed.

name GC.Spread.Sheets.Worksheet#RangeChanged

param The sheet that triggered the event.

param The sheet's name.

param The range's row index.

param The range's column index.

param The range's row count.

param The range's column count.

param A collection of table names.

param The positions of the cells whose data has changed, each position has row and col.

param The type of action that raises the RangeChanged event.

param Whether this event is from a undo operation.

example

//This example returns the sheet name and action when changing the cell range in Microsoft Internet Explorer.
 activeSheet.bind(GC.Spread.Sheets.Events.RangeChanged, function (sender, args) {
  console.log(args.sheetName, args.action);
});

RangeFilterCleared

Static RangeFilterCleared: string

Occurs when a range column has just been clear filtered.

name GC.Spread.Sheets.Worksheet#RangeFilterCleared

param The sheet that triggered the event.

param The sheet's name.

param The index of the sheet column has just been clear filtered.

example

//This example uses the RangeFilterCleared event.
activeSheet.getCell(0,0).text("Name");
activeSheet.getCell(0,1).text("Value");
activeSheet.getCell(0,2).text("T/F");
activeSheet.getCell(1,0).text("AW");
activeSheet.getCell(1,1).text("5");
activeSheet.getCell(1,2).text("T");
var cellRange =new GC.Spread.Sheets.Range(0, 0, 5, 1);
var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellRange);
activeSheet.rowFilter(hideRowFilter);
activeSheet.bind(GC.Spread.Sheets.Events.RangeFilterCleared, function (e, info) {
        alert("Col (" + info.col + ")");
});

RangeFilterClearing

Static RangeFilterClearing: string

Occurs when a range column is about to be automatically clear filter.

name GC.Spread.Sheets.Worksheet#RangeFilterClearing

param The sheet that triggered the event.

param The sheet's name.

param The index of the sheet column to be automatically clear filter.

example

//This example uses the RangeFilterClearing event.
activeSheet.getCell(0,0).text("Name");
activeSheet.getCell(0,1).text("Value");
activeSheet.getCell(0,2).text("T/F");
activeSheet.getCell(1,0).text("AW");
activeSheet.getCell(1,1).text("5");
activeSheet.getCell(1,2).text("T");
var cellRange =new GC.Spread.Sheets.Range(0, 0, 5, 1);
var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellRange);
activeSheet.rowFilter(hideRowFilter);
activeSheet.bind(GC.Spread.Sheets.Events.RangeFilterClearing, function (e, info) {
        alert("Col (" + info.col + ")");
});

RangeFiltered

Static RangeFiltered: string

Occurs when a column has just been automatically filtered.

name GC.Spread.Sheets.Worksheet#RangeFiltered

param The sheet that triggered the event.

param The sheet's name.

param The index of the column that was automatically filtered.

param The values by which the column was filtered.

param The condition rule info that which the column was filtered.

example

//This example uses the RangeFiltered event.
var cellrange =new GC.Spread.Sheets.Range(0, 2, 5, 1);
var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange);
activeSheet.rowFilter(hideRowFilter);
activeSheet.bind(GC.Spread.Sheets.Events.RangeFiltered, function (e, info) {
        alert("Col (" + info.col + ")");
});

RangeFiltering

Static RangeFiltering: string

Occurs when a column is about to be automatically filtered.

name GC.Spread.Sheets.Worksheet#RangeFiltering

param The sheet that triggered the event.

param The sheet's name.

param The index of the column to be automatically filtered.

param The values by which to filter the column.

param The condition rule info by which to filter the column.

example

//This example uses the RangeFiltering event.
var cellrange =new GC.Spread.Sheets.Range(0, 2, 5, 1);
var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange);
activeSheet.rowFilter(hideRowFilter);
activeSheet.bind(GC.Spread.Sheets.Events.RangeFiltering, function (e, info) {
       alert("Col (" + info.col + ")");
});

RangeGroupStateChanged

Static RangeGroupStateChanged: string

Occurs when the user has changed the outline state (range group) for rows or columns.

name GC.Spread.Sheets.Worksheet#RangeGroupStateChanged

param The sheet that triggered the event.

param The sheet's name.

param Whether the outline (range group) is a group of rows.

param The index of the RangeGroupInfo object whose state has changed.

param The level of the RangeGroupInfo object whose state has changed.

example

//This example uses the RangeGroupStateChanged event.
activeSheet.suspendPaint();
activeSheet.setRowCount(34);
activeSheet.setValue(0,0,"Western");
activeSheet.setValue(0,1,"Western");
activeSheet.setValue(0,2,"Western");
activeSheet.setValue(1,0,"A");
activeSheet.setValue(1,1,"B");
activeSheet.setValue(1,2,"C");
activeSheet.setValue(2,0,"A");
activeSheet.setValue(2,1,"B");
activeSheet.setValue(2,2,"C");
activeSheet.rowOutlines.group(0,2);
activeSheet.columnOutlines.group(0,1);
activeSheet.resumePaint();
activeSheet.bind(GC.Spread.Sheets.Events.RangeGroupStateChanged, function (e, info) {
        alert("Level (" + info.level + ")");
});

RangeGroupStateChanging

Static RangeGroupStateChanging: string

Occurs before the user changes the outline state (range group) for rows or columns.

name GC.Spread.Sheets.Worksheet#RangeGroupStateChanging

param The sheet that triggered the event.

param The sheet's name.

param Whether the outline (range group) is a group of rows.

param The index of the RangeGroupInfo object whose state is changing.

param The level of the RangeGroupInfo object whose state is changing.

param A value that indicates whether the operation should be canceled.

example

//This example uses the RangeGroupStateChanging event.
activeSheet.suspendPaint();
activeSheet.setRowCount(34);
activeSheet.setValue(0,0,"Western");
activeSheet.setValue(0,1,"Western");
activeSheet.setValue(0,2,"Western");
activeSheet.setValue(1,0,"A");
activeSheet.setValue(1,1,"B");
activeSheet.setValue(1,2,"C");
activeSheet.setValue(2,0,"A");
activeSheet.setValue(2,1,"B");
activeSheet.setValue(2,2,"C");
activeSheet.rowOutlines.group(0,2);
activeSheet.columnOutlines.group(0,1);
activeSheet.resumePaint();
activeSheet.bind(GC.Spread.Sheets.Events.RangeGroupStateChanging, function (e, info) {
        alert("Level (" + info.level + ")");
});

RangeSorted

Static RangeSorted: string

Occurs when a column has just been automatically sorted.

name GC.Spread.Sheets.Worksheet#RangeSorted

param The sheet that triggered the event.

param The sheet's name.

param The index of the column that was automatically sorted.

param Whether the automatic sort is ascending.

example

//This example uses the RangeSorted event.
activeSheet.setValue(0, 0, 10);
activeSheet.setValue(1, 0, 100);
activeSheet.setValue(2, 0, 50);
activeSheet.setValue(3, 0, 40);
activeSheet.setValue(4, 0, 80);
activeSheet.setValue(5, 0, 1);
activeSheet.setValue(6, 0, 65);
activeSheet.setValue(7, 0, 20);
activeSheet.setValue(8, 0, 30);
activeSheet.setValue(9, 0, 35);
var cellrange =new GC.Spread.Sheets.Range(0, 0, 5, 1);
var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange);
activeSheet.rowFilter(hideRowFilter);
activeSheet.bind(GC.Spread.Sheets.Events.RangeSorted, function (e, info) {
        alert("Col (" + info.col + ", " + info.ascending +")");
});

RangeSorting

Static RangeSorting: string

Occurs when a column is about to be automatically sorted.

name GC.Spread.Sheets.Worksheet#RangeSorting

param The sheet that triggered the event.

param The sheet's name.

param The index of the column to be automatically sorted.

param Whether the automatic sort is ascending.

param Whether the operation should be canceled.

param The range of automatic sort.

param The groupSort level to use when sorting, default will use group level if contains group and use flat level if not contains group.

param Whether to ignore the hidden values and only sort visible values.

param The customize function to use when sorting, used when value sort. function (value1, value2) {return 0;}

example

//This example uses the RangeSorting event.
activeSheet.setValue(0, 0, 10);
activeSheet.setValue(1, 0, 100);
activeSheet.setValue(2, 0, 50);
activeSheet.setValue(3, 0, 40);
activeSheet.setValue(4, 0, 80);
activeSheet.setValue(5, 0, 1);
activeSheet.setValue(6, 0, 65);
activeSheet.setValue(7, 0, 20);
activeSheet.setValue(8, 0, 30);
activeSheet.setValue(9, 0, 35);
var cellrange =new GC.Spread.Sheets.Range(0, 0, 10, 1);
var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange);
activeSheet.rowFilter(hideRowFilter);
activeSheet.bind(GC.Spread.Sheets.Events.RangeSorting, function (e, info) {
        alert("Col (" + info.col + ", " + info.ascending +")");
        info.groupSort = GC.Spread.Sheets.GroupSort.full; //use full level sort.
        info.ignoreHidden = false; // sort with the hidden values.
        info.compareFunction = (obj1, obj2)=>{return obj1.toString().localeCompare(obj2.toString())};
});

RowChanged

Static RowChanged: string

Occurs when a change is made to a row or range of rows in this sheet that may require the row or range of rows to be repainted.

name GC.Spread.Sheets.Worksheet#RowChanged

param The sheet that triggered the event.

param The sheet's name.

param The row index.

param The sheetArea of the row.

param The name of the row's property that has changed.

param Whether this event is from a undo operation.

example

//This example uses the RowChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.RowChanged, function (e, info) {
        alert("Row (" + info.row + ")");
});

RowChanging

Static RowChanging: string

Occurs when before a change is made to a row or range of rows in this sheet that may require the row or range of rows to be repainted.

name GC.Spread.Sheets.Worksheet#RowChanging

param The sheet that triggered the event.

param The sheet's name.

param The row index.

param The sheetArea of the row.

param The name of the row's property that has changed.

example

//This example uses the RowChanging event.
activeSheet.bind(GC.Spread.Sheets.Events.RowChanging, function (e, info) {
        alert("Row (" + info.row + ")");
});

RowHeightChanged

Static RowHeightChanged: string

Occurs when the row height has changed.

name GC.Spread.Sheets.Worksheet#RowHeightChanged

param The sheet that triggered the event.

param The sheet's name.

param The list of rows whose heights have changed.

param Whether the columns are column header columns.

example

//This example uses the RowHeightChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.RowHeightChanged, function (e, info) {
        alert("Row List (" + info.rowList + ")");
});

RowHeightChanging

Static RowHeightChanging: string

Occurs when the row height is changing.

name GC.Spread.Sheets.Worksheet#RowHeightChanging

param The sheet that triggered the event.

param The sheet's name.

param The list of rows whose heights are changing.

param Whether the columns are column header columns.

param A value that indicates whether the operation should be canceled.

example

//This example uses the RowHeightChanging event.
activeSheet.bind(GC.Spread.Sheets.Events.RowHeightChanging, function (e, info) {
        alert("Row List (" + info.rowList + ")");
});

RowOperation

Static RowOperation: string

Occurs when the applied row action is operated.

name GC.Spread.Sheets.TableSheet.TableSheet#RowOperation

param The table sheet that triggered the event.

param The table sheet's name.

param The row action type.

param The row index.

example

//This example uses the RowOperation event.
workbook.bind(GC.Spread.Sheets.Events.RowOperation, function (e, info) {
    console.log(info.sheetName, info.actionType, info.row);
});

SelectionChanged

Static SelectionChanged: string

Occurs when the selection of cells on the sheet has changed.

name GC.Spread.Sheets.Worksheet#SelectionChanged

param The sheet that triggered the event.

param The sheet's name.

param The old selection ranges.

param The new selection ranges.

example

//This example uses the SelectionChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function (e, info) {
        alert("Name (" + info.sheetName + ")");
});

SelectionChanging

Static SelectionChanging: string

Occurs when the selection of cells on the sheet is changing.

name GC.Spread.Sheets.Worksheet#SelectionChanging

param The sheet that triggered the event.

param The sheet's name.

param The old selection ranges.

param The new selection ranges.

example

//This example uses the SelectionChanging event.
activeSheet.bind(GC.Spread.Sheets.Events.SelectionChanging, function (e, info) {
//Use IE to see console
        console.log("Name (" + info.sheetName + ")");
});

ShapeChanged

Static ShapeChanged: string

Occurs when any shape has changed.

name GC.Spread.Sheets.Worksheet#ShapeChanged

param The sheet that triggered the event.

param The sheet's name.

param The shape that triggered the event.

param The name of the shape's property that has changed.

example

//This example uses the ShapeChanged event.
var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 20, 20, 200, 200);
activeSheet.bind(GC.Spread.Sheets.Events.ShapeChanged, function (e, info) {
       alert("changed");
});

ShapeRemoved

Static ShapeRemoved: string

Occurs when the user has removed the shape.

name GC.Spread.Sheets.Worksheet#ShapeRemoved

param The sheet that triggered the event.

param The sheet's name.

param The shape has been removed.

example

//This example uses the ShapeRemoved event.
var shape = activeSheet.shapes.add("myShape", GC.Spread.Sheets.Shapes.AutoShapeType.diamond, 0, 90, 200, 200);
activeSheet.bind(GC.Spread.Sheets.Events.ShapeRemoved, function (e, info) {
        alert(info.shape.name());
});

ShapeRemoving

Static ShapeRemoving: string

Occurs when the user is removing any shape.

name GC.Spread.Sheets.Worksheet#ShapeRemoving

param The sheet that triggered the event.

param The sheet's name.

param The shape is being removed.

param A value that indicates whether the operation should be canceled.

example

//This example uses the ShapeRemoving event.
var shape = sheet.shapes.add("myShape", GC.Spread.Sheets.Shapes.AutoShapeType.diamond, 0, 90, 200, 200);
activeSheet.bind(GC.Spread.Sheets.Events.ShapeRemoving, function (e, info) {
        info.cancel = true;// the shape will not remove
});

ShapeSelectionChanged

Static ShapeSelectionChanged: string

Occurs when the selections of the shape have changed.

name GC.Spread.Sheets.Worksheet#ShapeSelectionChanged

param The sheet that triggered the event.

param The sheet's name.

param The shape that triggered the event.

example

//This example uses the ShapeSelectionChanged event.
var shape = sheet.shapes.add("myShape", GC.Spread.Sheets.Shapes.AutoShapeType.diamond, 0, 90, 200, 200);
activeSheet.bind(GC.Spread.Sheets.Events.ShapeSelectionChanged, function (e, info) {
       console.log("event info: " + info);
});

SheetChanged

Static SheetChanged: string

After sheet changed.

name GC.Spread.Sheets.Worksheet#SheetChanged

param The sheet's name.

param The specific operation name.

param Change the sheet position.

param Sheet changes the value of the previous attribute(isVisible, isSelected...).

param Sheet changes the value of the attribute(isVisible, isSelected...).

example

//This example.
spread.bind(GC.Spread.Sheets.Events.SheetChanged, function (sender, args) {
    var sheet = args.sheet;
});

SheetChanging

Static SheetChanging: string

Before sheet changed.

name GC.Spread.Sheets.Worksheet#SheetChanging

param The sheet's name.

param The specific operation name .

param Change the sheet position.

param Sheet changes the value of the previous attribute(isVisible, isSelected...).

param Sheet changes the value of the attribute(isVisible, isSelected...).

param Cancel the current operation.

example

//This example.
spread.bind(GC.Spread.Sheets.Events.SheetChanging, function (sender, args) {
    var sheetIndex = args.sheetIndex;
    args.cancel = true;
});

SheetMoved

Static SheetMoved: string

Occurs after the user drags and moves the sheet.

name GC.Spread.Sheets.Worksheet#SheetMoved

param The sheet that triggered the event.

param The sheet's name.

param The previous sheet index.

param The new sheet index.

example

//This example uses the SheetMoved event.
window.onload = function(){
     var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
     var activeSheet = spread.getActiveSheet();
     spread.bind(GC.Spread.Sheets.Events.SheetMoving, function (e, data) {
         alert(data.sheetName + '\n' +  'oldIndex: ' + data.oldIndex + '\n' +  'newIndex: ' + data.newIndex + '\n' +  'cancel: ' + data.cancel);
     });
     spread.bind(GC.Spread.Sheets.Events.SheetMoved, function (e, data) {
         alert(data.sheetName + '\n' +  'oldIndex: ' + data.oldIndex + '\n' +  'newIndex: ' + data.newIndex);
     });
}

SheetMoving

Static SheetMoving: string

Occurs before the user drags and moves the sheet.

name GC.Spread.Sheets.Worksheet#SheetMoving

param The sheet that triggered the event.

param The sheet's name.

param The old sheet index.

param A value that indicates the index will be moved to.

param A value that indicates whether the operation should be canceled.

example

//This example uses the SheetMoving event.
window.onload = function(){
     var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
     var activeSheet = spread.getActiveSheet();
     spread.bind(GC.Spread.Sheets.Events.SheetMoving, function (e, data) {
         alert(data.sheetName + '\n' +  'oldIndex: ' + data.oldIndex + '\n' +  'newIndex: ' + data.newIndex + '\n' +  'cancel: ' + data.cancel);
     });
     spread.bind(GC.Spread.Sheets.Events.SheetMoved, function (e, data) {
         alert(data.sheetName + '\n' +  'oldIndex: ' + data.oldIndex + '\n' +  'newIndex: ' + data.newIndex);
     });
}

SheetNameChanged

Static SheetNameChanged: string

Occurs when the user has changed the sheet name.

name GC.Spread.Sheets.Worksheet#SheetNameChanged

param The sheet that triggered the event.

param The sheet's old name.

param The sheet's new name.

example

//This example uses the SheetNameChanged event.
// Use IE to see the console log text
spread.bind(GC.Spread.Sheets.Events.SheetNameChanging, function (sender, args) {
   console.log(args.oldValue);
});
spread.bind(GC.Spread.Sheets.Events.SheetNameChanged, function (sender, args) {
   console.log(args.newValue);
});

SheetNameChanging

Static SheetNameChanging: string

Occurs when the user is changing the sheet name.

name GC.Spread.Sheets.Worksheet#SheetNameChanging

param The sheet that triggered the event.

param The sheet's old name.

param The sheet's new name.

param A value that indicates whether the operation should be canceled.

example

//This example uses the SheetNameChanging event.
// Use IE to see the console log text
spread.bind(GC.Spread.Sheets.Events.SheetNameChanging, function (sender, args) {
   console.log(args.oldValue);
});
spread.bind(GC.Spread.Sheets.Events.SheetNameChanged, function (sender, args) {
   console.log(args.newValue);
});

SheetTabClick

Static SheetTabClick: string

Occurs when the user clicks the sheet tab.

name GC.Spread.Sheets.Worksheet#SheetTabClick

param The sheet that triggered the event.

param The sheet's name.

param The index of the sheet tab that the user clicked.

example

//This example uses the SheetTabClick event.
spread.bind(GC.Spread.Sheets.Events.SheetTabClick, function (e, info) {
        alert("Index (" + info.sheetTabIndex + ")");
});

SheetTabDoubleClick

Static SheetTabDoubleClick: string

Occurs when the user double-clicks the sheet tab.

name GC.Spread.Sheets.Worksheet#SheetTabDoubleClick

param The sheet that triggered the event.

param The sheet's name.

param The index of the sheet tab that the user double-clicked.

example

//This example uses the SheetTabDoubleClick event.
spread.bind(GC.Spread.Sheets.Events.SheetTabDoubleClick, function (e, info) {
        alert("Index (" + info.sheetTabIndex + ")");
});

SlicerChanged

Static SlicerChanged: string

Occurs when any slicer has changed.

name GC.Spread.Sheets.Worksheet#SlicerChanged

param The sheet that triggered the event.

param The sheet's name.

param The slicer that triggered the event.

param The name of the slicer's property that has changed.

example

//This example uses the SlicerChanged event.
//create a table
datas = [
    ["1", "NewYork", "1968/6/8", "80", "180"],
    ["4", "NewYork", "1972/7/3", "72", "168"],
    ["4", "NewYork", "1964/3/2", "71", "179"],
    ["5", "Washington", "1972/8/8","80", "171"],
    ["6", "Washington", "1986/2/2", "89", "161"],
    ["7", "Washington", "2012/2/15", "71", "240"]];
var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
table.setColumnName(0, dataColumns[0]);
table.setColumnName(1, dataColumns[1]);
table.setColumnName(2, dataColumns[2]);
table.setColumnName(3, dataColumns[3]);
table.setColumnName(4, dataColumns[4]);
//add a slicer to the sheet and return the slicer instance.
var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
//change the slicer properties.
slicer.width(200);
slicer.height(200);
slicer.position(new GC.Spread.Sheets.Point(100, 200));
slicer.style(GC.Spread.Sheets.Slicers.SlicerStyles.dark4());
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.SlicerChanged, function (e, info) {
console.log("name: " + info.propertyName);
});

SparklineChanged

Static SparklineChanged: string

Occurs when the sparkline has changed.

name GC.Spread.Sheets.Worksheet#SparklineChanged

param The sheet that triggered the event.

param The sheet's name.

param The sparkline whose property has changed.

example

//Removing the sparkline causes a change.
var data = new GC.Spread.Sheets.Range(1, 0, 8, 1);
var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
setting.options.showMarkers = true;
setting.options.lineWeight = 3;
setting.options.displayXAxis = true;
setting.options.showFirst = true;
setting.options.showLast = true;
setting.options.showLow = true;
setting.options.showHigh = true;
setting.options.showNegative = true;
setting.options.seriesColor = "Text 2 1";
setting.options.firstMarkerColor = "Text 2 3";
setting.options.negativeColor = "Accent 2 1";
setting.options.markersColor = "Accent 3 1";
setting.options.lowMarkerColor = "Accent 4 1";
setting.options.highMarkerColor = "Accent 6 1";
setting.options.lastMarkerColor = "Accent 6 6";
setting.options.axisColor = "Text 1 1";
activeSheet.addSpan(13, 0, 4, 3, null);
activeSheet.setSparkline(13, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
activeSheet.setValue(1, 0, 1);
activeSheet.setValue(2, 0, -2);
activeSheet.setValue(3, 0, -1);
activeSheet.setValue(4, 0, 6);
activeSheet.setValue(5, 0, 4);
activeSheet.setValue(6, 0, -4);
activeSheet.setValue(7, 0, 3);
activeSheet.setValue(8, 0, 8);
// Use IE to see the console log text
activeSheet.bind(GC.Spread.Sheets.Events.SparklineChanged, function (e, info) {
     console.log("name: " + info.sheetName);
});
$("#button1").click(function () {
     activeSheet.removeSparkline(13, 0);
});

TableColumnsChanged

Static TableColumnsChanged: string

Occurs when the user insert/delete columns in table.

name GC.Spread.Sheets.Worksheet#TableColumnsChanged

param The sheet that triggered the event.

param The table which is insert/delete rows.

param The operation name which trigger event.

param The index of the starting column to insert/delete based on table index.

param The number of columns to insert/delete.

param Whether insert columns before the specified column index or after. By default is false, insert before.

example

//This example uses the TableColumnsChanged event.
window.onload = function(){
     var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
     var activeSheet = spread.getActiveSheet();
     spread.bind(GC.Spread.Sheets.Events.TableColumnsChanged, function (e, data) {});
}

TableFilterCleared

Static TableFilterCleared: string

Occurs when a table column has just been clear filter.

name GC.Spread.Sheets.Worksheet#TableFilterCleared

param The sheet that triggered the event.

param The sheet's name.

param The table column to be automatically filtered.

param The index of the table column has just been clear filter.

example

//This example uses the TableFilterCleared event.
activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableTheme.dark1);
activeSheet.getCell(0,0).text("Name");
activeSheet.getCell(0,1).text("Value");
activeSheet.getCell(0,2).text("T/F");
activeSheet.getCell(1,0).text("AW");
activeSheet.getCell(1,1).text("5");
activeSheet.getCell(1,2).text("T");
activeSheet.bind(GC.Spread.Sheets.Events.TableFilterCleared, function (e, info) {
       alert("Sheet (" + info.sheetName + ")");
});

TableFilterClearing

Static TableFilterClearing: string

Occurs when a table column is about to be automatically clear filter.

name GC.Spread.Sheets.Worksheet#TableFilterCleared

param The sheet that triggered the event.

param The sheet's name.

param The table column to be automatically filtered.

param The index of the table column to be automatically clear filter.

example

//This example uses the TableFilterClearing event.
activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableTheme.dark1);
activeSheet.getCell(0,0).text("Name");
activeSheet.getCell(0,1).text("Value");
activeSheet.getCell(0,2).text("T/F");
activeSheet.getCell(1,0).text("AW");
activeSheet.getCell(1,1).text("5");
activeSheet.getCell(1,2).text("T");
activeSheet.bind(GC.Spread.Sheets.Events.TableFilterClearing, function (e, info) {
       alert("Sheet (" + info.sheetName + ")");
});

TableFiltered

Static TableFiltered: string

Occurs when a table column has just been automatically filtered.

name GC.Spread.Sheets.Worksheet#TableFiltered

param The sheet that triggered the event.

param The sheet's name.

param The table column to be automatically filtered.

param The index of the table column to be automatically filtered.

param The values by which to filter the column.

param The condition rule info by which to filter the column.

example

//This example uses the TableFiltered event.
activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableTheme.dark1);
activeSheet.getCell(0,0).text("Name");
activeSheet.getCell(0,1).text("Value");
activeSheet.getCell(0,2).text("T/F");
activeSheet.getCell(1,0).text("AW");
activeSheet.getCell(1,1).text("5");
activeSheet.getCell(1,2).text("T");
activeSheet.bind(GC.Spread.Sheets.Events.TableFiltered, function (e, info) {
       alert("Sheet (" + info.sheetName + ")");
});

TableFiltering

Static TableFiltering: string

Occurs when a table column is about to be automatically filtered.

name GC.Spread.Sheets.Worksheet#TableFiltering

param The sheet that triggered the event.

param The sheet's name.

param The table column to be automatically filtered.

param The index of the table column to be automatically filtered.

param The values by which to filter the column.

param The condition rule info by which to filter the column.

example

//This example uses the TableFiltering event.
activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableTheme.dark1);
activeSheet.getCell(0,0).text("Name");
activeSheet.getCell(0,1).text("Value");
activeSheet.getCell(0,2).text("T/F");
activeSheet.getCell(1,0).text("AW");
activeSheet.getCell(1,1).text("5");
activeSheet.getCell(1,2).text("T");
activeSheet.bind(GC.Spread.Sheets.Events.TableFiltering, function (e, info) {
       alert("Sheet (" + info.sheetName + ")");
});

TableResized

Static TableResized: string

Occurs after the user resized table.

name GC.Spread.Sheets.Worksheet#TableResized

param The sheet that triggered the event.

param The table which is resized.

param The table range before resize.

param The table range after resize.


TableResizing

Static TableResizing: string

Occurs when the user resizing table by resize handler.

name GC.Spread.Sheets.Worksheet#TableResizing

param The sheet that triggered the event.

param The table which is resizing.

param The table range before resize.

param The table range after resize.

example

//This example uses the TableResizing and TableResized event.
window.onload = function(){
     var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
     var activeSheet = spread.getActiveSheet();
     spread.bind(GC.Spread.Sheets.Events.TableResizing, function (e, data) {});
     spread.bind(GC.Spread.Sheets.Events.TableResized, function (e, data) {});
}

TableRowsChanged

Static TableRowsChanged: string

Occurs when the user insert/delete rows in table.

name GC.Spread.Sheets.Worksheet#TableRowsChanged

param The sheet that triggered the event.

param The table which is insert/delete rows.

param The operation name which trigger event.

param The index of the starting row to insert/delete based on table index.

param The number of rows to insert/delete.

param Whether insert rows before the specified row index or after. By default is false, insert before.

param The deleted rows collection in binding. The every item in array specifies deleted data item.

example

//This example uses the TableRowsChanged event.
window.onload = function(){
     var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
     var activeSheet = spread.getActiveSheet();
     spread.bind(GC.Spread.Sheets.Events.TableRowsChanged, function (e, data) {});
}

TopRowChanged

Static TopRowChanged: string

Occurs when the top row changes.

name GC.Spread.Sheets.Worksheet#TopRowChanged

param The sheet that triggered the event.

param The sheet's name.

param The old top row index.

param The new top row index.

example

//This example synchronizes vertical and horizontal scrolling for sheet 1 and sheet 2.
var sheet1 = spread.getSheet(0),
sheet2 = spread.getSheet(1);
sheet1.bind(GC.Spread.Sheets.Events.TopRowChanged, function (sender, args) {
    //Set the displayed top row of sheet1 to sheet2 (vertical scroll synchronization).
    sheet2.showRow(args.newTopRow, GC.Spread.Sheets.VerticalPosition.top);
});
sheet1.bind(GC.Spread.Sheets.Events.LeftColumnChanged, function (sender, args) {
    //Set the displayed left column of sheet1 to sheet2 (Horizontal scroll synchronization).
    sheet2.showColumn(args.newLeftCol, GC.Spread.Sheets.HorizontalPosition.left);
});

TouchToolStripOpening

Static TouchToolStripOpening: string

Occurs before the touch toolbar pops up.

name GC.Spread.Sheets.Worksheet#TouchToolStripOpening

param The x-coordinate of the horizontal position.

param The y-coordinate of the vertical position.

param If true, the touch toolbar is prevented from popping up; otherwise, the toolbar is displayed at the default position.

example

//This example uses the TouchToolStripOpening event.
 activeSheet.bind(GC.Spread.Sheets.Events.TouchToolStripOpening, function (e, info) {
        alert(info.x);
});

UserFormulaEntered

Static UserFormulaEntered: string

Occurs when the user types a formula.

name GC.Spread.Sheets.Worksheet#UserFormulaEntered

param The sheet that triggered the event.

param The sheet's name.

param The row index of the cell in which the user entered a formula.

param The column index of the cell in which the user entered a formula.

param The formula that the user entered.

param The entered formula is circular reference.

example

//This example uses the UserFormulaEntered event.
 activeSheet.bind(GC.Spread.Sheets.Events.UserFormulaEntered, function (e, info) {
        alert("Formula (" + info.formula + ")");
});

ValidationError

Static ValidationError: string

Occurs when the applied cell value is invalid.

name GC.Spread.Sheets.Worksheet#ValidationError

param The sheet that triggered the event.

param The sheet's name.

param The cell's row index.

param The cell's column index.

param The data validator that caused the error.

param The policy that the user can set to determine how to process the error.

example

//This example uses the ValidationError event.
var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition);
nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.equalsTo);
nCondition.expected(0);
//When the option is false, the validation fails and the red alert is displayed.
//When the option is true, the blank cell is treated as zero and the validation is successful.
nCondition.treatNullValueAsZero(false);
var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition)
validator.ignoreBlank(false);
validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.wholeNumber)
activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator);
spread.options.highlightInvalidData = true;
activeSheet.setValue(0, 0, null);
//Type different values in cell (0,0). This event fires if the user types an invalid value.
activeSheet.bind("ValidationError", vError);
function vError(sender, args) {
    alert("error");
}

ValueChanged

Static ValueChanged: string

Occurs when the value in the subeditor changes.

name GC.Spread.Sheets.Worksheet#ValueChanged

param The sheet that triggered the event.

param The sheet's name.

param The row index of the cell.

param The column index of the cell.

param The old value of the cell.

param The new value of the cell.

example

//This example uses the ValueChanged event.
activeSheet.bind(GC.Spread.Sheets.Events.ValueChanged, function (e, info) {
        alert("Value (" + info.newValue + ")");
});

ViewZoomed

Static ViewZoomed: string

Occurs after the user zooms.

name GC.Spread.Sheets.Worksheet#ViewZoomed

param The sheet that triggered the event.

param The sheet's name.

param The new zoom factor.

param The old zoom factor.

example

//This example uses the ViewZoomed event.
spread.options.allowUserZoom = true;
activeSheet.bind(GC.Spread.Sheets.Events.ViewZoomed, function (e, info) {
     alert("Zoom (" + info.newZoomFactor + ")");
});

ViewZooming

Static ViewZooming: string

Occurs when the user zooms.

name GC.Spread.Sheets.Worksheet#ViewZooming

param The sheet that triggered the event.

param The sheet's name.

param The new zoom factor, user could make some change to intervene the real zoom action.

param The old zoom factor.

param A value that indicates whether the operation should be canceled.

example

//This example uses the ViewZooming event, to limit zooming max factor.
spread.options.allowUserZoom = true;
activeSheet.bind(GC.Spread.Sheets.Events.ViewZooming, function (e, info) {
     if (info.newZoomFactor >= 2) {
         info.newZoomFactor = 2;
     }
});