# GC.Spread.Slicers.GeneralSlicerData

## Content

# Class: GeneralSlicerData

[Spread](../modules/GC.Spread).[Slicers](../modules/GC.Spread.Slicers).GeneralSlicerData

## Hierarchy

- **`GeneralSlicerData`**

  ↳ [`TableSlicerData`](GC.Spread.Sheets.Slicers.TableSlicerData)

## Table of contents

### Constructors

- [constructor](GC.Spread.Slicers.GeneralSlicerData#constructor)

### Properties

- [columnNames](GC.Spread.Slicers.GeneralSlicerData#columnnames)
- [data](GC.Spread.Slicers.GeneralSlicerData#data)

### Methods

- [aggregateData](GC.Spread.Slicers.GeneralSlicerData#aggregatedata)
- [attachListener](GC.Spread.Slicers.GeneralSlicerData#attachlistener)
- [clearPreview](GC.Spread.Slicers.GeneralSlicerData#clearpreview)
- [detachListener](GC.Spread.Slicers.GeneralSlicerData#detachlistener)
- [doFilter](GC.Spread.Slicers.GeneralSlicerData#dofilter)
- [doUnfilter](GC.Spread.Slicers.GeneralSlicerData#dounfilter)
- [getColumnIndex](GC.Spread.Slicers.GeneralSlicerData#getcolumnindex)
- [getData](GC.Spread.Slicers.GeneralSlicerData#getdata)
- [getExclusiveData](GC.Spread.Slicers.GeneralSlicerData#getexclusivedata)
- [getExclusiveRowIndex](GC.Spread.Slicers.GeneralSlicerData#getexclusiverowindex)
- [getFilteredIndexes](GC.Spread.Slicers.GeneralSlicerData#getfilteredindexes)
- [getFilteredOutIndexes](GC.Spread.Slicers.GeneralSlicerData#getfilteredoutindexes)
- [getFilteredOutRanges](GC.Spread.Slicers.GeneralSlicerData#getfilteredoutranges)
- [getFilteredOutRowIndexes](GC.Spread.Slicers.GeneralSlicerData#getfilteredoutrowindexes)
- [getFilteredRanges](GC.Spread.Slicers.GeneralSlicerData#getfilteredranges)
- [getFilteredRowIndexes](GC.Spread.Slicers.GeneralSlicerData#getfilteredrowindexes)
- [getRowIndexes](GC.Spread.Slicers.GeneralSlicerData#getrowindexes)
- [inPreview](GC.Spread.Slicers.GeneralSlicerData#inpreview)
- [onColumnNameChanged](GC.Spread.Slicers.GeneralSlicerData#oncolumnnamechanged)
- [onColumnsRemoved](GC.Spread.Slicers.GeneralSlicerData#oncolumnsremoved)
- [onDataChanged](GC.Spread.Slicers.GeneralSlicerData#ondatachanged)
- [onFiltered](GC.Spread.Slicers.GeneralSlicerData#onfiltered)
- [onRowsAdded](GC.Spread.Slicers.GeneralSlicerData#onrowsadded)
- [onRowsRemoved](GC.Spread.Slicers.GeneralSlicerData#onrowsremoved)
- [resumeFilteredEvents](GC.Spread.Slicers.GeneralSlicerData#resumefilteredevents)
- [suspendFilteredEvents](GC.Spread.Slicers.GeneralSlicerData#suspendfilteredevents)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new GeneralSlicerData**(`data`, `columnNames`)

Represents general slicer data.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `data` | `any`[][] | The slicer data; it is a matrix array. |
| `columnNames` | `string`[] | The column names of the slicer data. |

## Properties

### <a id="columnnames" name="columnnames"></a> columnNames

• **columnNames**: `string`[]

Indicates the column names for the general slicer data.

___

### <a id="data" name="data"></a> data

• **data**: `any`[][]

Indicates the data source for general slicer data.

## Methods

### <a id="aggregatedata" name="aggregatedata"></a> 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`](../enums/GC.Spread.Slicers.SlicerAggregateType) | The aggregate type. |
| `range?` | [`ISlicerRangeConditional`](../interfaces/GC.Spread.Slicers.ISlicerRangeConditional) | The specific range. range.min: number type, the minimum value. range.max: number type, the maximum value. |

#### Returns

`number`

The aggregated data.

___

### <a id="attachlistener" name="attachlistener"></a> attachListener

▸ **attachListener**(`listener`): `void`

Attaches the listener.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `listener` | [`ISlicerListener`](../interfaces/GC.Spread.Slicers.ISlicerListener) | The listener. |

#### Returns

`void`

___

### <a id="clearpreview" name="clearpreview"></a> clearPreview

▸ **clearPreview**(): `void`

Clears the preview filter state.

#### Returns

`void`

___

### <a id="detachlistener" name="detachlistener"></a> detachListener

▸ **detachListener**(`listener`): `void`

Detaches the listener.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `listener` | [`ISlicerListener`](../interfaces/GC.Spread.Slicers.ISlicerListener) | The listener. |

#### Returns

`void`

___

### <a id="dofilter" name="dofilter"></a> 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`](../interfaces/GC.Spread.Slicers.ISlicerConditional) | The conditional filter. conditional.exclusiveRowIndexes: number array type, visible exclusive row indexes conditional.ranges: {min:number, max:number} array type, visible ranges. |
| `isPreview?` | `boolean` | Indicates whether preview is set. |

#### Returns

`void`

___

### <a id="dounfilter" name="dounfilter"></a> 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`

___

### <a id="getcolumnindex" name="getcolumnindex"></a> 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.

___

### <a id="getdata" name="getdata"></a> getData

▸ **getData**(`columnName`, `range?`): `string`[]

Gets the data by the specified column name.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `columnName` | `string` | The column name. |
| `range?` | [`ISlicerRangeConditional`](../interfaces/GC.Spread.Slicers.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.

___

### <a id="getexclusivedata" name="getexclusivedata"></a> 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.

___

### <a id="getexclusiverowindex" name="getexclusiverowindex"></a> 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.

___

### <a id="getfilteredindexes" name="getfilteredindexes"></a> 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.

___

### <a id="getfilteredoutindexes" name="getfilteredoutindexes"></a> 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`](../enums/GC.Spread.Slicers.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.

___

### <a id="getfilteredoutranges" name="getfilteredoutranges"></a> getFilteredOutRanges

▸ **getFilteredOutRanges**(`columnName`): [`ISlicerRangeConditional`](../interfaces/GC.Spread.Slicers.ISlicerRangeConditional)[]

Gets the filtered out ranges by other columns.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `columnName` | `string` | The column name. |

#### Returns

[`ISlicerRangeConditional`](../interfaces/GC.Spread.Slicers.ISlicerRangeConditional)[]

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

___

### <a id="getfilteredoutrowindexes" name="getfilteredoutrowindexes"></a> getFilteredOutRowIndexes

▸ **getFilteredOutRowIndexes**(): `number`[]

Gets the filtered out row indexes.

#### Returns

`number`[]

The filtered out row indexes.

___

### <a id="getfilteredranges" name="getfilteredranges"></a> getFilteredRanges

▸ **getFilteredRanges**(`columnName`): [`ISlicerRangeConditional`](../interfaces/GC.Spread.Slicers.ISlicerRangeConditional)[]

Gets the filtered ranges by the specified column name.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `columnName` | `string` | The column name. |

#### Returns

[`ISlicerRangeConditional`](../interfaces/GC.Spread.Slicers.ISlicerRangeConditional)[]

The filtered ranges that correspond to the specified column name.

___

### <a id="getfilteredrowindexes" name="getfilteredrowindexes"></a> getFilteredRowIndexes

▸ **getFilteredRowIndexes**(): `number`[]

Gets the filtered row indexes.

#### Returns

`number`[]

The filtered row indexes.

___

### <a id="getrowindexes" name="getrowindexes"></a> 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.

___

### <a id="inpreview" name="inpreview"></a> inPreview

▸ **inPreview**(): `boolean`

Gets whether the slicer is in the preview state.

#### Returns

`boolean`

___

### <a id="oncolumnnamechanged" name="oncolumnnamechanged"></a> 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`

___

### <a id="oncolumnsremoved" name="oncolumnsremoved"></a> 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`

___

### <a id="ondatachanged" name="ondatachanged"></a> onDataChanged

▸ **onDataChanged**(`changedDataItems`): `void`

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

#### Parameters

| Name | Type |
| :------ | :------ |
| `changedDataItems` | [`ISlicerDataItem`](../interfaces/GC.Spread.Slicers.ISlicerDataItem) |

#### Returns

`void`

___

### <a id="onfiltered" name="onfiltered"></a> onFiltered

▸ **onFiltered**(): `void`

Occurs after the slicer data has been filtered.

#### Returns

`void`

___

### <a id="onrowsadded" name="onrowsadded"></a> 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`

___

### <a id="onrowsremoved" name="onrowsremoved"></a> 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`

___

### <a id="resumefilteredevents" name="resumefilteredevents"></a> resumeFilteredEvents

▸ **resumeFilteredEvents**(): `void`

Resumes the onFiltered event.

#### Returns

`void`

___

### <a id="suspendfilteredevents" name="suspendfilteredevents"></a> suspendFilteredEvents

▸ **suspendFilteredEvents**(): `void`

Suspends the onFiltered event.

#### Returns

`void`
