[]
        
(Showing Draft Content)

GC.Spread.Pivot.CustomPivotTableThemeManager

Class: CustomPivotTableThemeManager

Spread.Pivot.CustomPivotTableThemeManager

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new CustomPivotTableThemeManager(workbook)

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

Parameters

Name Type Description
workbook Workbook The workbook.

Overrides

CustomThemeManagerBase.constructor

Methods

add

add(theme): undefined | PivotTableTheme

add a new pivot table theme.

example

// add a new pivot table theme named "custom0"
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let pivotTableStyle = spread.customPivotTableThemes.add("custom0");
let wholeTableStyle = new GC.Spread.Pivot.PivotTableStyle();
wholeTableStyle.backColor = "#0C66E4";
tableStyle.wholeTableStyle(wholeTableStyle);

Parameters

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

Returns

undefined | PivotTableTheme

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


all

all(): PivotTableTheme[]

get the pivot table themes collection.

example

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

Returns

PivotTableTheme[]

Array<GC.Spread.Pivot.PivotTableTheme>


get

get(name): undefined | PivotTableTheme

get the pivot table theme by name.

example

// get pivot table theme
pivotTableStyle = spread.customPivotTableThemes.get("custom0");

Parameters

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

Returns

undefined | PivotTableTheme

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


remove

remove(name): void

remove the pivot table theme by name.

example

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

Parameters

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

Returns

void


update

update(oldThemeName, newTheme): void

update the pivot table theme.

example

// update pivot table theme
tableStyle = spread.customPivotTableThemes.update("custom0", new GC.Spread.Pivot.PivotTableTheme());

Parameters

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

Returns

void