React 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");

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 value of the current cell.

Return Value: any

The cell value.

value(field)

Gets the value of any field linked with the current cell.

Parameters:

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

Return Value: any

The field value.

Use this method when you need extra information about the current cell. You can get the value of any field to which the cell belongs.

value(field, isCalculatedValue)

Gets the value of any field linked with the current cell.

Parameters:

The field whose value to return.

isCalculatedValue:

Boolean

Specifies whether or not to return a post-processed value. Pass false here to get the initial summary value.

Return Value: any

The field value.

Use this method when you need extra information about the current cell. You can use the value of any field to which the cell belongs.

value(isCalculatedValue)

Gets the value of the current cell.

Parameters:
isCalculatedValue:

Boolean

Specifies whether or not to return a post-processed value. Pass false here to get the initial summary value.

Return Value: any

The cell value.