Expand All

  Getting Started



  Row Models




  Third Party


Github stars make projects look great. Please help, donate a star, it's free.
Read about ag-Grid's Partnership with webpack.
Get informed on releases and other ag-Grid news only - never spam.
Follow on Twitter

Cell Expressions

In the section on value getters you will have seen how you can use expressions when defining how to get the value for a cell. However a shortcoming of this approach, is that the expression belongs to the column and cannot be defined as part of the data.

Cell Expressions bring the expression power to the cell level, so your grid can act similar to how spreadsheets work.

To enable cell expressions, set enableCellExpressions=true in the gridOptions. Then, whenever the grid comes across a value starting with '=', it will treat it as an expression.

The cell expression has the same parameters of value getter expressions, which are as follows:

  • ctx: maps context
  • node: maps node
  • data: maps data
  • colDef: maps colDef
  • api: maps api
  • getValue: maps getValue

Because you have access to the context (ctx) in your expression, you can add functions to the context to be available in your expressions. This allows you limitless power in what you can calculated for your expression. For example, you could provide a function that takes values from outside of the grid.


The example blow shows cell expressions in action. The second column values in the LHS (Left Hand Side) grid all have expressions.

'Number Squared' and 'Number x 2' both take the number from the header as an input.

'Todays Date' prints the date.

'Sum A' and 'Sum B' both call a user provided function that is attached to the context.