Interface FrozenFields
Frozen Fields
Frozen fields are fields that do not scroll horizontally with other fields, remaining on the screen while other fields may be scrolled off. This feature is typically used to allow basic identifying information (like an "accountId") to remain on screen while the user scrolls through a large number of related fields. Fields can be programmatically frozen via setting
field.frozen
to true when the
grid is created, or dynamically frozen and unfrozen via freezeField()
and unfreezeField()
. The setting canFreezeFields
enables a user
interface to allow end users to dynamically freeze and unfreeze fields.
The frozen fields feature is not compatible with the following features:
-
AutoFitData
:"horizontal", as well as headers that autoFit to titles (normally enabled viafield.overflow:"visible"
) - the
CubeGrid
subclass of ListGrid - nested grids
TreeGrid
subclass of ListGrid, and all dynamic
styling-related and formatting-related features. The ListGrid.frozenFieldsMaxWidth
property may be used to specify a maximum size for the frozen
fields. If their combined width exceeds this, a horizontal scrollbar will be displayed,
allowing the user to scroll the frozen fields independently of the other fields in the grid.
Troubleshooting tip: If you encounter misalignment between rows in frozen and unfrozen columns, this is likely due to one of the following causes:
- Inconsistent border/padding: all cells in a row in a table must have the same top and bottom border thickness, and all cells in a column must have the same horizontal border and padding width, or the table is invalid, with no clear rules for rendering it. The HTML/CSS spec doesn't say what to do in this situation, and browser engines behave inconsistently.
- For grids with
fixedRecordHeights:true
, the cell contents, inclusive of border and padding, needs to be less than your configuredListGrid.cellHeight
, or you need to setListGrid.enforceVClipping
to cause us to clip it as necessary. Breaking this rule can cause misalignment between rows in frozen and unfrozen columns as some fields have cells with taller content. (This does not apply for grids withfixedRecordHeights
set to false).
- See Also:
-
ListGridField.getAutoFreezePosition()
ListGrid.freezeField(com.smartgwt.client.widgets.grid.ListGridField)
ListGrid.unfreezeField(com.smartgwt.client.widgets.grid.ListGridField)
com.smartgwt.client.widgets.grid.ListGrid#toggleFrozen
ListGridField.getFrozen()
ListGridField.getCanFreeze()
ListGridField.getAutoFreeze()
ListGrid.getFrozenBaseStyle()
ListGrid.getShrinkForFreeze()
ListGrid.getFrozenHeaderBaseStyle()
ListGrid.getFrozenHeaderTitleStyle()
ListGrid.getCanFreezeFields()