customizeCell(customizationFunction:Function)

Renders each cell and can change its content. Allows adding links, custom styles, formatting. Available both as an initialization parameter or an API call.

Parameters

Gets customizationFunction as an input parameter. customizationFunction has the following signature:

function customizeCellFunction(cellBuilder, cellData)

cellBuilder object contains information about cell representation and provides methods for cell customization. Structure of cellBuilder:

Name Type Description
attr Object All atributes and their values. attr allow adding custom attributes, which later can be used in CSS selectors. Additional info about CSS attribute selectors.
classes Array of Strings All cell classes. New class can be added via addClass() method
style Object Cell CSS object.
tag String Tag element of each cell.
text String Cell text (may contain HTML, such as images).
addClass(value: String) Method Adds new classes to the cell.
toHtml() Method Returns the cell as an HTML string.

cellData object contains information about cell data. Structure of cellData:

Name Type Description
columnIndex Number Column number of the current cell (starts from 0).
columns Array of Objects Information about cell column.
hierarchy Objects Information about cell hierarchy.
isClassicTotalRow Boolean If true, the cell is from the total row in the classic view.
isDrillThrough Boolean If true, the cell is from the drill through view.
isGrandTotal Boolean If true, the cell is from the grand total column/row.
isGrandTotalColumn Boolean If true, the cell is from the grand total column.
isGrandTotalRow Boolean If true, the cell is from the grand total row.
isTotal Boolean If true, the cell is from the total column/row.
isTotalColumn Boolean If true, the cell is from the total column.
isTotalRow Boolean If true, the cell is from the total row.
label String Cell label.
level Number Cell data level (in case of multilevel hierarchies).
measure Object Information about cell measure.
member Object Information about cell member.
rowIndex Number Row number of the current cell (starts from 0).
rows Array of Objects Information about cell row.
type String Cell type (“header” or “value”).
value Number Cell value (only when type = “value”).

Example

Add alternating colors for rows: