# GC.Spread.Pivot.PivotTable.PivotTableViewManager

## Content

# Class: PivotTableViewManager

[Pivot](../modules/GC.Spread.Pivot).[PivotTable](../modules/GC.Spread.Pivot.PivotTable).PivotTableViewManager

## Table of contents

### Constructors

- [constructor](GC.Spread.Pivot.PivotTable.PivotTableViewManager#constructor)

### Methods

- [add](GC.Spread.Pivot.PivotTable.PivotTableViewManager#add)
- [all](GC.Spread.Pivot.PivotTable.PivotTableViewManager#all)
- [apply](GC.Spread.Pivot.PivotTable.PivotTableViewManager#apply)
- [get](GC.Spread.Pivot.PivotTable.PivotTableViewManager#get)
- [remove](GC.Spread.Pivot.PivotTable.PivotTableViewManager#remove)
- [save](GC.Spread.Pivot.PivotTable.PivotTableViewManager#save)

## Constructors

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

• **new PivotTableViewManager**(`applyCallback`, `saveCallback`)

Represents a PivotTableViewManager.

#### Parameters

| Name | Type |
| :------ | :------ |
| `applyCallback` | `Function` |
| `saveCallback` | `Function` |

## Methods

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

▸ **add**(`view`): `boolean`

**`description`** Add a view to pivot table views.

**`example`**
```javascript
var viewsManager = pivotTable.views;
viewsManager.add({
     name: 'config1',
     config: pivotTable.serialize()
});
viewsManager.get('config1');
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `view` | [`IPivotTableView`](../modules/GC.Spread.Pivot#ipivottableview) | Indicates the view to add. |

#### Returns

`boolean`

___

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

▸ **all**(): [`IPivotTableView`](../modules/GC.Spread.Pivot#ipivottableview)[]

**`description`** get all views from pivot table views.

**`example`**
```javascript
var viewsManager = pivotTable.views;
viewsManager.save('config1');
console.log(viewsManager.all());
```

#### Returns

[`IPivotTableView`](../modules/GC.Spread.Pivot#ipivottableview)[]

___

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

▸ **apply**(`name`): `void`

**`description`** apply a view to current pivot table.

**`example`**
```javascript
var viewsManager = pivotTable.views;
viewsManager.save('config1');
viewsManager.apply('config1');
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | Indicates the name of view to apply. |

#### Returns

`void`

___

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

▸ **get**(`name`): [`IPivotTableView`](../modules/GC.Spread.Pivot#ipivottableview)

**`description`** get a view from pivot table views.

**`example`**
```javascript
var viewsManager = pivotTable.views;
viewsManager.save('config1');
viewsManager.get('config1');
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | Indicates the name of view to query. |

#### Returns

[`IPivotTableView`](../modules/GC.Spread.Pivot#ipivottableview)

___

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

▸ **remove**(`name`): `void`

**`description`** remove a view from pivot table views.

**`example`**
```javascript
var viewsManager = pivotTable.views;
viewsManager.remove('config1');
viewsManager.get('config1');
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | Indicates the name of view to remove. |

#### Returns

`void`

___

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

▸ **save**(`name`): `boolean`

**`description`** Add a view to pivot table views.

**`example`**
```javascript
var viewsManager = pivotTable.views;
viewsManager.save('config1');
viewsManager.get('config1');
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | Indicates the name of view to save. |

#### Returns

`boolean`
