Defines the RevFocus class, which manages cell focus and cell editing within a grid component. It holds the central logic for managing which cell is focused and how cell editing is triggered and maintained in the grid UI.
It is recommended to set focus with methods in RevFocusSelectBehavior instead of using the methods in RevFocus. The RevFocusSelectBehavior methods will ensure that focus
and selection
remain suitably co-ordinated.
When sorting or filtering a grid, the location of focus in the grid may change. To ensure that the same cell remains focused after the sort or filter operation, a 'stash' of the focus location is created prior to the operation and then the focus is restored using the 'stash' after the operation. In order to generate the stash, it is necessary to implement the RevDataServer getRowIndexFromId() function. If this is not implemented, focus will be lost after sort or filter operations. When restoring focus from a 'stash', the getRowIndexFromId() function will be used if it is implemented. Otherwise, the getRowIdFromIndex() will be used.