[]
        
(Showing Draft Content)

GC.Spread.Sheets.Tables.CustomTableThemeManager

Class: CustomTableThemeManager

Sheets.Tables.CustomTableThemeManager

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new CustomTableThemeManager(workbook)

Represents a custom table theme manager that can manage all custom table themes.

Parameters

Name Type Description
workbook Workbook The workbook.

Overrides

CustomThemeManagerBase.constructor

Methods

add

add(theme): undefined | TableTheme

add a new table theme.

example

// add a new table theme named "custom0"
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let tableStyle = spread.customTableThemes.add("custom0");
let firstColumnStripStyle = new GC.Spread.Sheets.Tables.TableStyle();
firstColumnStripStyle.backColor = "#0C66E4";
tableStyle.firstColumnStripStyle(firstColumnStripStyle);

Parameters

Name Type Description
theme string | TableTheme the new table theme or just a new table theme name you want to add

Returns

undefined | TableTheme

return the newly added table theme, if the named table theme is existed, failed to add table theme and return undefined


all

all(): TableTheme[]

get the table themes collection.

example

// get all table table themes
let tableStylesCollection = spread.customTableThemes.all();

Returns

TableTheme[]

Array<GC.Spread.Sheets.Tables.TableTheme>


get

get(name): undefined | TableTheme

get the table theme by name.

example

// get table theme
tableStyle = spread.customTableThemes.get("custom0");

Parameters

Name Type Description
name string the specific name of the table theme to get

Returns

undefined | TableTheme

If the corresponding table theme with the spefic name is found, return the theme; otherwise, return undefined.


remove

remove(name): void

remove the table theme by name.

example

// delete table theme
spread.customTableThemes.remove("custom0");

Parameters

Name Type Description
name string the specific name of the table theme to remove

Returns

void


update

update(oldThemeName, newTheme): void

update the table theme.

example

// update table theme
tableStyle = spread.customTableThemes.update("custom0", new GC.Spread.Sheets.Tables.TableTheme());

Parameters

Name Type Description
oldThemeName string the specific name of the table theme to update
newTheme TableTheme the specific name of the table theme to update

Returns

void