[]
        
(Showing Draft Content)

GC.Spread.Sheets.CellState.CellStateManager

Class: CellStateManager

Sheets.CellState.CellStateManager

Table of contents

Constructors

Methods

Constructors

constructor

new CellStateManager(sheet)

Represents a cellstate manager that can manage all cell state in a sheet.

Parameters

Name Type Description
sheet Worksheet The worksheet.

Methods

add

add(range, state, style, sheetArea?): void

description Add cell state instance for range , which will apply style of cellState when the state of range cell matched.

example

var style = new  GC.Spread.Sheets.Style();
style.backColor = 'blue';
style.foreColor = 'red';
var range = new GC.Spread.Sheets.Range(1,2,3,3);
sheet.cellStates.add(range,GC.Spread.Sheets.CellStatesType.hover,style,101);

Parameters

Name Type Description
range Range The scope range which will apply style of cellState.
state CellStatesType Which state will use style.
style Style Which style when the state is matched.
sheetArea? SheetArea The sheet area. If this parameter is not provided, it defaults to viewport.

Returns

void


clear

clear(range, sheetArea): void

description Clear all style by range, after clear there are no style will be applied when the cell state is matched.

example

var range = new GC.Spread.Sheets.Range(1,2,3,3);
sheet.cellStates.clear(range, GC.Spread.Sheets.SheetArea.viewport);

Parameters

Name Type Description
range Range The scope range for clear.
sheetArea SheetArea The sheet area. If this parameter is not provided, it defaults to viewport.

Returns

void