All docs
V19.2
24.2
The page you are viewing does not exist in version 24.2.
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

JavaScript/jQuery PivotGrid Summary Cell

An object exposing methods that manipulate a summary cell and provide access to its neighboring cells.

Type:

Object

child(direction, fieldValue)

Gets the child cell in a specified direction.

Parameters:
direction:

String

The direction in which to search for the child cell. Can be "row" or "column".

fieldValue:

Number

|

String

The value of the child field whose summary cell should be returned.

Return Value:

Summary Cell

The child cell.

Use this method for Total and Grand Total cells to get one of the cells, whose value is involved in the calculation of the total value. The image below demonstrates what cell will be returned by the following code.

JavaScript
var targetCell = sourceCell.child("row", 8); //August is the 8th month

This method is opposite to the parent(direction) method.

children(direction)

Gets all child cells in a specified direction.

Parameters:
direction:

String

The direction in which to search for child cells. Can be "row" or "column".

Return Value:

Array<Summary Cell>

The array of child cells.

This method is a general case of the child(direction, fieldValue) method. It returns all the cells whose values were involved in a calculation of the total value. Use it for Total and Grand Total cells.

field(area)

Gets a pivot grid field that corresponds to the summary cell.

Parameters:
area:

String

The area from which to get the field: "row", "column", or "data".

Return Value:

PivotGrid Field

The pivot grid field.

If the header items are expanded and the cell belongs to multiple fields, the field of the deepest expanded header item is returned. The image below demonstrates what field will be returned by the following code.

JavaScript
var columnField = sourceCell.field("column");

grandTotal()

Gets the Grand Total of the entire pivot grid.

Return Value:

Summary Cell

The Grand Total cell.

grandTotal(direction)

Gets a partial Grand Total cell of a row or column.

Parameters:
direction:

String

The direction in which to search for the grand total cell. Can be "row" or "column".

Return Value:

Summary Cell

The partial Grand Total cell.

The image below demonstrates what cell will be returned by the following code.

JavaScript
var targetCell = sourceCell.grandTotal("row");

isPostProcessed(field)

Indicates whether the summaryDisplayMode or calculateSummaryValue post-processed the summary value.

Parameters:

The index in the fields array, dataField, or caption of the field.

Return Value:

Boolean

true if the summary value was post-processed; otherwise, false.

next(direction)

Gets the cell next to the current one in a specified direction.

Parameters:
direction:

String

The direction in which to search for the next cell. Can be "row" or "column".

Return Value:

Summary Cell

The cell next to the current one.

This method is opposite of the prev(direction) method.

next(direction, allowCrossGroup)

Gets the cell next to current in a specified direction.

Parameters:
direction:

String

The direction in which to search for the next cell. Can be "row" or "column".

allowCrossGroup:

Boolean

Specifies whether to allow this method to return cells from groups other than the current one.

Return Value:

Summary Cell

The cell next to the current one.

This method is opposite of the prev(direction, allowCrossGroup) method.

parent(direction)

Gets the parent cell in a specified direction.

Parameters:
direction:

String

The direction in which to search for the parent cell. Can be "row" or "column".

Return Value:

Summary Cell

The parent cell.

This method is opposite of the child(direction, fieldValue) method.

prev(direction)

Gets the cell prior to the current one in a specified direction.

Parameters:
direction:

String

The direction in which to search for the previous cell. Can be "row" or "column".

Return Value:

Summary Cell

The cell before the current one.

This method is opposite of the next(direction) method.

prev(direction, allowCrossGroup)

Gets the cell previous to current in a specified direction.

Parameters:
direction:

String

The direction in which to search for the previous cell. Can be "row" or "column".

allowCrossGroup:

Boolean

Specifies whether to allow this method to return cells from groups other than the current one.

Return Value:

Summary Cell

The cell previous to the current one.

This method is opposite to the next(direction, allowCrossGroup) method.

slice(field, value)

Gets the cell located by the path of the source cell with one field value changed.

Parameters:

The index in the fields array, dataField or caption of the field.

value:

Number

|

String

The field's value.

Return Value:

Summary Cell

The target cell.

Use this method when you need to get a cell located by the similar path with one of its components changed. The image below demonstrates what cell will be returned by the following code.

JavaScript
var targetCell = sourceCell.slice("year", 1998);

value()

Gets the summary cell value.

Return Value: any

The summary cell value.

value(field)

Gets the value of any field associated with the summary cell.

Parameters:

The index in the fields array, dataField, or caption of the field.

Return Value: any

The field value.

value(field, postProcessed)

Gets the value of any field associated with the summary cell.

Parameters:

The index in the fields array, dataField, or caption of the field.

postProcessed:

Boolean

Pass true to get a value post-processed by summaryDisplayMode or calculateSummaryValue; pass false to get the original summary value.

Return Value: any

The field value.

value(postProcessed)

Gets the summary cell value.

Parameters:
postProcessed:

Boolean

Pass true to get a value post-processed by summaryDisplayMode or calculateSummaryValue; pass false to get the original summary value.

Return Value: any

The summary cell value.