[]
        
(Showing Draft Content)

GC.Spread.Sheets.Slicers.TableSlicerData

Class: TableSlicerData

Sheets.Slicers.TableSlicerData

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new TableSlicerData(table)

Represents table slicer data.

example

//This example creates a slicer for the table.
//create table
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" },
    { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" },
    { Name: "Alice", City: "Washington", Birthday: "2012/2/15" },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table)
//Set slicer data to item slicer.
var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name");
//Add the item slicer to the dom tree.
//The "slicerHost" is the div you want to add the slicer's dom to.
$("#slicerHost").append(slicer.getDOMElement());

Parameters

Name Type Description
table Table The table.

Overrides

GeneralSlicerData.constructor

Properties

columnNames

columnNames: string[]

Indicates the column names for the general slicer data.

Inherited from

GeneralSlicerData.columnNames


data

data: any[][]

Indicates the data source for general slicer data.

Inherited from

GeneralSlicerData.data

Methods

aggregateData

aggregateData(columnName, aggregateType, range?): number

Aggregates the data by the specified column name.

Parameters

Name Type Description
columnName string The column name.
aggregateType SlicerAggregateType The aggregate type.
range? ISlicerRangeConditional The specific range. range.min: number type, the minimum value. range.max: number type, the maximum value.

Returns

number

The aggregated data.

Inherited from

GeneralSlicerData.aggregateData


attachListener

attachListener(listener): void

Attaches the listener.

Parameters

Name Type Description
listener ISlicerListener The listener.

Returns

void

Inherited from

GeneralSlicerData.attachListener


clearPreview

clearPreview(): void

Clears the preview filter state.

Returns

void

Inherited from

GeneralSlicerData.clearPreview


detachListener

detachListener(listener): void

Detaches the listener.

Parameters

Name Type Description
listener ISlicerListener The listener.

Returns

void

Inherited from

GeneralSlicerData.detachListener


doFilter

doFilter(columnName, conditional, isPreview?): void

Filters the data that corresponds to the specified column name and exclusive data indexes.

Parameters

Name Type Description
columnName string The column name.
conditional ISlicerConditional The filter conditional. conditional.exclusiveRowIndexes: number array type, visible exclusive row indexes conditional.ranges: {min:number, max:number} array type, visible ranges.
isPreview? boolean -

Returns

void

Overrides

GeneralSlicerData.doFilter


doUnfilter

doUnfilter(columnName): void

Unfilters the data that corresponds to the specified column name.

Parameters

Name Type Description
columnName string The column name.

Returns

void

Overrides

GeneralSlicerData.doUnfilter


getColumnIndex

getColumnIndex(columnName): number

Gets the column index by the specified column name.

Parameters

Name Type Description
columnName string The column name.

Returns

number

The column index.

Inherited from

GeneralSlicerData.getColumnIndex


getData

getData(columnName, range?): string[]

Gets the data by the specified column name.

Parameters

Name Type Description
columnName string The column name.
range? ISlicerRangeConditional The specific range. range.min: number type, the minimum value. range.max: number type, the maximum value.

Returns

string[]

The data that corresponds to the specified column name.

Inherited from

GeneralSlicerData.getData


getExclusiveData

getExclusiveData(columnName): any[]

Gets the exclusive data by the specified column name.

Parameters

Name Type Description
columnName string The column name.

Returns

any[]

The exclusive data that corresponds to the specified column name.

Inherited from

GeneralSlicerData.getExclusiveData


getExclusiveRowIndex

getExclusiveRowIndex(columnName, rowIndex): number

Gets the exclusive data index by the specified column name and data index.

Parameters

Name Type Description
columnName string The column name.
rowIndex number The index of the data.

Returns

number

The exclusive data index that corresponds to the specified column name and data index.

Inherited from

GeneralSlicerData.getExclusiveRowIndex


getFilteredIndexes

getFilteredIndexes(columnName): number[]

Gets the filtered exclusive data indexes by the specified column name.

Parameters

Name Type Description
columnName string The column name.

Returns

number[]

The filtered exclusive data indexes that correspond to the specified column name.

Inherited from

GeneralSlicerData.getFilteredIndexes


getFilteredOutIndexes

getFilteredOutIndexes(columnName, filteredOutDataType): number[]

Gets the filtered out exclusive data indexes by the specified column name.

Parameters

Name Type Description
columnName string The column name.
filteredOutDataType FilteredOutDataType Indicates the kind of filtered out exclusive data index that should be included in the result.

Returns

number[]

The filtered out exclusive data indexes that correspond to the specified column name.

Inherited from

GeneralSlicerData.getFilteredOutIndexes


getFilteredOutRanges

getFilteredOutRanges(columnName): ISlicerRangeConditional[]

Gets the filtered out ranges by other columns.

Parameters

Name Type Description
columnName string The column name.

Returns

ISlicerRangeConditional[]

The filtered out ranges by other columns that correspond to the specified column name.

Inherited from

GeneralSlicerData.getFilteredOutRanges


getFilteredOutRowIndexes

getFilteredOutRowIndexes(): number[]

Gets the filtered out row indexes.

Returns

number[]

The filtered out row indexes.

Inherited from

GeneralSlicerData.getFilteredOutRowIndexes


getFilteredRanges

getFilteredRanges(columnName): ISlicerRangeConditional[]

Gets the filtered ranges by the specified column name.

Parameters

Name Type Description
columnName string The column name.

Returns

ISlicerRangeConditional[]

The filtered ranges that correspond to the specified column name.

Inherited from

GeneralSlicerData.getFilteredRanges


getFilteredRowIndexes

getFilteredRowIndexes(): number[]

Gets the filtered row indexes.

Returns

number[]

The filtered row indexes.

Inherited from

GeneralSlicerData.getFilteredRowIndexes


getRowIndexes

getRowIndexes(columnName, exclusiveRowIndex): number[]

Gets the data indexes by the specified column name and exclusive data index.

Parameters

Name Type Description
columnName string The column name.
exclusiveRowIndex number The index of the exclusive data.

Returns

number[]

The data indexes that correspond to the specified column name and exclusive data index.

Inherited from

GeneralSlicerData.getRowIndexes


getSlicerData

getSlicerData(): TableSlicerData

Gets the slicer data of the table.

Returns

TableSlicerData

The slicer data of the table.


getTable

getTable(): Table

Gets the table of the table slicer data.

Returns

Table

The table of the table slicer data.


inPreview

inPreview(): boolean

Gets whether the slicer is in the preview state.

Returns

boolean

Inherited from

GeneralSlicerData.inPreview


onColumnNameChanged

onColumnNameChanged(oldName, newName): void

Changes a column name for the general slicer data.

Parameters

Name Type Description
oldName string The old name of the column.
newName string The new name of the column.

Returns

void

Inherited from

GeneralSlicerData.onColumnNameChanged


onColumnsRemoved

onColumnsRemoved(colIndex, colCount): void

Removes columns of the general slicer data.

Parameters

Name Type Description
colIndex number The index of the starting column.
colCount number The number of columns to remove.

Returns

void

Inherited from

GeneralSlicerData.onColumnsRemoved


onDataChanged

onDataChanged(changedDataItems): void

Changes data items in the data source of the general slicer data.

Parameters

Name Type
changedDataItems ISlicerDataItem

Returns

void

Inherited from

GeneralSlicerData.onDataChanged


onFiltered

onFiltered(): void

Occurs after the slicer data has been filtered.

Returns

void

Inherited from

GeneralSlicerData.onFiltered


onRowsAdded

onRowsAdded(rowIndex, rowCount): void

Adds rows in the data source of the general slicer data.

Parameters

Name Type Description
rowIndex number The index of the starting row.
rowCount number The number of rows to add.

Returns

void

Inherited from

GeneralSlicerData.onRowsAdded


onRowsRemoved

onRowsRemoved(rowIndex, rowCount): void

Removes rows in the data source of the general slicer data.

Parameters

Name Type Description
rowIndex number The index of the starting row.
rowCount number The number of rows to remove.

Returns

void

Inherited from

GeneralSlicerData.onRowsRemoved


refresh

refresh(): void

Refreshes the table slicer data.

Returns

void


resumeFilteredEvents

resumeFilteredEvents(): void

Resumes the onFiltered event.

Returns

void

Inherited from

GeneralSlicerData.resumeFilteredEvents


suspendFilteredEvents

suspendFilteredEvents(): void

Suspends the onFiltered event.

Returns

void

Inherited from

GeneralSlicerData.suspendFilteredEvents