[]
Sheets.Slicers.TableSlicerData
↳ TableSlicerData
• 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());
Name | Type | Description |
---|---|---|
table |
Table |
The table. |
• columnNames: string
[]
Indicates the column names for the general slicer data.
• data: any
[][]
Indicates the data source for general slicer data.
▸ aggregateData(columnName
, aggregateType
, range?
): number
Aggregates the data by the specified column name.
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. |
number
The aggregated data.
GeneralSlicerData.aggregateData
▸ attachListener(listener
): void
Attaches the listener.
Name | Type | Description |
---|---|---|
listener |
ISlicerListener |
The listener. |
void
GeneralSlicerData.attachListener
▸ clearPreview(): void
Clears the preview filter state.
void
GeneralSlicerData.clearPreview
▸ detachListener(listener
): void
Detaches the listener.
Name | Type | Description |
---|---|---|
listener |
ISlicerListener |
The listener. |
void
GeneralSlicerData.detachListener
▸ doFilter(columnName
, conditional
, isPreview?
): void
Filters the data that corresponds to the specified column name and exclusive data indexes.
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 |
- |
void
▸ doUnfilter(columnName
): void
Unfilters the data that corresponds to the specified column name.
Name | Type | Description |
---|---|---|
columnName |
string |
The column name. |
void
▸ getColumnIndex(columnName
): number
Gets the column index by the specified column name.
Name | Type | Description |
---|---|---|
columnName |
string |
The column name. |
number
The column index.
GeneralSlicerData.getColumnIndex
▸ getData(columnName
, range?
): string
[]
Gets the data by the specified column name.
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. |
string
[]
The data that corresponds to the specified column name.
▸ getExclusiveData(columnName
): any
[]
Gets the exclusive data by the specified column name.
Name | Type | Description |
---|---|---|
columnName |
string |
The column name. |
any
[]
The exclusive data that corresponds to the specified column name.
GeneralSlicerData.getExclusiveData
▸ getExclusiveRowIndex(columnName
, rowIndex
): number
Gets the exclusive data index by the specified column name and data index.
Name | Type | Description |
---|---|---|
columnName |
string |
The column name. |
rowIndex |
number |
The index of the data. |
number
The exclusive data index that corresponds to the specified column name and data index.
GeneralSlicerData.getExclusiveRowIndex
▸ getFilteredIndexes(columnName
): number
[]
Gets the filtered exclusive data indexes by the specified column name.
Name | Type | Description |
---|---|---|
columnName |
string |
The column name. |
number
[]
The filtered exclusive data indexes that correspond to the specified column name.
GeneralSlicerData.getFilteredIndexes
▸ getFilteredOutIndexes(columnName
, filteredOutDataType
): number
[]
Gets the filtered out exclusive data indexes by the specified column name.
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. |
number
[]
The filtered out exclusive data indexes that correspond to the specified column name.
GeneralSlicerData.getFilteredOutIndexes
▸ getFilteredOutRanges(columnName
): ISlicerRangeConditional
[]
Gets the filtered out ranges by other columns.
Name | Type | Description |
---|---|---|
columnName |
string |
The column name. |
The filtered out ranges by other columns that correspond to the specified column name.
GeneralSlicerData.getFilteredOutRanges
▸ getFilteredOutRowIndexes(): number
[]
Gets the filtered out row indexes.
number
[]
The filtered out row indexes.
GeneralSlicerData.getFilteredOutRowIndexes
▸ getFilteredRanges(columnName
): ISlicerRangeConditional
[]
Gets the filtered ranges by the specified column name.
Name | Type | Description |
---|---|---|
columnName |
string |
The column name. |
The filtered ranges that correspond to the specified column name.
GeneralSlicerData.getFilteredRanges
▸ getFilteredRowIndexes(): number
[]
Gets the filtered row indexes.
number
[]
The filtered row indexes.
GeneralSlicerData.getFilteredRowIndexes
▸ getRowIndexes(columnName
, exclusiveRowIndex
): number
[]
Gets the data indexes by the specified column name and exclusive data index.
Name | Type | Description |
---|---|---|
columnName |
string |
The column name. |
exclusiveRowIndex |
number |
The index of the exclusive data. |
number
[]
The data indexes that correspond to the specified column name and exclusive data index.
GeneralSlicerData.getRowIndexes
▸ getSlicerData(): TableSlicerData
Gets the slicer data of the table.
The slicer data of the table.
▸ getTable(): Table
Gets the table of the table slicer data.
The table of the table slicer data.
▸ inPreview(): boolean
Gets whether the slicer is in the preview state.
boolean
▸ onColumnNameChanged(oldName
, newName
): void
Changes a column name for the general slicer data.
Name | Type | Description |
---|---|---|
oldName |
string |
The old name of the column. |
newName |
string |
The new name of the column. |
void
GeneralSlicerData.onColumnNameChanged
▸ onColumnsRemoved(colIndex
, colCount
): void
Removes columns of the general slicer data.
Name | Type | Description |
---|---|---|
colIndex |
number |
The index of the starting column. |
colCount |
number |
The number of columns to remove. |
void
GeneralSlicerData.onColumnsRemoved
▸ onDataChanged(changedDataItems
): void
Changes data items in the data source of the general slicer data.
Name | Type |
---|---|
changedDataItems |
ISlicerDataItem |
void
GeneralSlicerData.onDataChanged
▸ onFiltered(): void
Occurs after the slicer data has been filtered.
void
▸ onRowsAdded(rowIndex
, rowCount
): void
Adds rows in the data source of the general slicer data.
Name | Type | Description |
---|---|---|
rowIndex |
number |
The index of the starting row. |
rowCount |
number |
The number of rows to add. |
void
▸ onRowsRemoved(rowIndex
, rowCount
): void
Removes rows in the data source of the general slicer data.
Name | Type | Description |
---|---|---|
rowIndex |
number |
The index of the starting row. |
rowCount |
number |
The number of rows to remove. |
void
GeneralSlicerData.onRowsRemoved
▸ refresh(): void
Refreshes the table slicer data.
void
▸ resumeFilteredEvents(): void
Resumes the onFiltered event.
void
GeneralSlicerData.resumeFilteredEvents
▸ suspendFilteredEvents(): void
Suspends the onFiltered event.
void