AgGrid allow you to apply transformers based on the column of your grid. This allow you to perform operations on the data before displaying it on the grid, without having to pre-process the data on the backend, reducing the load on your application.
TOC:
value_getter
is a property of the column definition that allows you to define a function that will be called to get the value of the cell. This function will receive the row data as a parameter and should return the value to be displayed on the cell.
If you have two columns col_a
and col_b
and you want to display the sum of these two columns in a third column sum
, you can define the value_getter
of sum
as follows:
value_formatter
is a property of the column definition that allows you to define a function that will be called to format the value of the cell. This function will receive the value of the cell as a parameter and should return the formatted value to be displayed on the cell.
If you have a column price
and you want to display the price with a currency symbol, you can define the value_formatter
of price
as follows:
Built with Reflex