[]
        
(Showing Draft Content)

GC.Spread.Sheets.Slicers.CustomSlicerThemeManager

Class: CustomSlicerThemeManager

Sheets.Slicers.CustomSlicerThemeManager

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new CustomSlicerThemeManager(workbook)

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

Parameters

Name Type Description
workbook Workbook The workbook.

Overrides

CustomThemeManagerBase.constructor

Methods

add

add(theme): undefined | SlicerStyle

add a new slicer theme.

example

// add a new slicer theme named "custom0"
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let slicerStyle = spread.customSlicerThemes.add("custom0");
let wholeSlicerStyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
wholeSlicerStyle.backColor = "#0C66E4";
slicerStyle.wholeSlicerStyle(wholeSlicerStyle);

Parameters

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

Returns

undefined | SlicerStyle

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


all

all(): SlicerStyle[]

get the slicer themes collection.

example

// get all slicer slicer themes
let slicerStylesCollection = spread.customSlicerThemes.all();

Returns

SlicerStyle[]

Array<GC.Spread.Sheets.Slicers.SlicerStyle>


get

get(name): undefined | SlicerStyle

get the slicer theme by name.

example

// get slicer theme
slicerStyle = spread.customSlicerThemes.get("custom0");

Parameters

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

Returns

undefined | SlicerStyle

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


remove

remove(name): void

remove the slicer theme by name.

example

// delete slicer theme
spread.customSlicerThemes.remove("custom0");

Parameters

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

Returns

void


update

update(oldThemeName, newTheme): void

update the slicer theme.

example

// update slicer theme
slicerStyle = spread.customSlicerThemes.update("custom0", new GC.Spread.Sheets.Slicers.SlicerStyle());

Parameters

Name Type Description
oldThemeName string the specific name of the slicer theme to update
newTheme SlicerStyle the specific name of the slicer theme to update

Returns

void