Cells
The FlexGrid module defines Row and Column classes, but no Cell class. That is because cells are just DOM elements created to represent the intersection of a Row and a Column.
When rendering, FlexGrid scans the rows and columns in the viewRange and generates a cell element for each combination. Cell elements are created based on a dataItem provided by the row and a binding provided by the column (along with some other properties).
The formatItem event
In some situations, you may want to customize the cell element based on the data (dynamic formatting), to create custom cell elements (templating), or not to use bindings at all (calculated columns, unbound grids).
In these cases, use the formatItem event to create or modify the cell elements. For example, the grid below shows sales below 1,000 in red and sales over 5,000 in green:
Getting and setting cell data
In most of the cases, you modify the data directly in the binding source object, and let the grid show the results. But in a few cases, you may want to get or set the data through the grid instead.
You can do this using the getCellData and setCellData methods in the GridPanel class. These methods offer options for getting raw or formatted data, coercing data types when setting data, and getting or setting data on unbound grids.