Package com.smartgwt.client.widgets.grid
Interface CellFormatter
public interface CellFormatter
Defines the HTML that's displayed in the cells of a
ListGridField
or entire
ListGrid
.-
Method Summary
Modifier and TypeMethodDescriptionformat
(Object value, ListGridRecord record, int rowNum, int colNum) Returns the HTML to display in the cells of the field (or entire grid if so applied).
-
Method Details
-
format
Returns the HTML to display in the cells of the field (or entire grid if so applied). Given the raw value for a field as taken from the record,format()
returns a display value as HTML. The value passed to this method is the raw value for the cell. ACellFormatter
defined at the field level takes precedence over one defined at the grid level for the cells of that field.Example usage: formatting a currency value stored in cents (so "100" to "$1.00")
Note: this formatter will not be applied to the values displayed in cells being edited. Define a
CellEditValueFormatter
and apply it to the field.- Parameters:
value
- raw value for the cell, from the record for the rowrecord
- Record object for the cell. Note: If this is a new row that has not been saved, in an editable grid, it has no associated record object. In this case the edit values will be passed in as this parameter (seeListGrid.getEditValues()
)rowNum
- row number for the cellcolNum
- column number for the cell.- Returns:
- HTML to display in the cell
- See Also:
-