RowManager
Virtual representation of the grid, using Row to represent rows. Plugs into Grid and exposes the following functions on grid itself:
let row = grid.getRowById(1);
Configs
4
Configs
4Number of rows to render below current viewport
Set to true to get a small performance boost in applications that uses fixed row height
Number of rows to render above current viewport
Default row height, assigned from Grid at construction (either from config rowHeight or CSS). Can be set from renderers
Properties
8
Properties
8Calculations
Total estimated grid height (used for scroller)
Other
Get actually used row height, which includes any border and might be an average if using variable row height.
Rows
Get the topmost visible Row
Get the last visible Row
Set a fixed row height (can still be overridden by renderers) or get configured row height. Setting refreshes all rows
Functions
18
Functions
18Calculations
Returns top and bottom for rendered row or estimated coordinates for unrendered.
| Parameter | Type | Description |
|---|---|---|
recordOrId | Model | String | Number | Record or record id |
local | Boolean | Pass true to get relative record coordinates |
roughly | Boolean | Pass true to allow a less exact but cheaper estimate |
Record bounds with format { x, y, width, height, bottom, right }
Returns top and bottom coordinates for specified row. If all heights are known, by for example using fixed row height, the top is calculated exactly. If not, the top is estimated based on the closest known row.
| Parameter | Type | Description |
|---|---|---|
recordIndex | Number | Record index |
local | Boolean |
Estimated record bounds
Iteration
Calls a function for each Row
| Parameter | Type | Description |
|---|---|---|
fn | function | Function that will be called with Row as first parameter |
Other
Invalidates all cached height and resets averageRowHeight and totalKnownHeight
Get the row at the specified Y coordinate, which is by default viewport-based.
| Parameter | Type | Description |
|---|---|---|
y | Number | The |
local | Boolean | Pass |
Found Row or null if no row is rendered at that point.
Invalidate cached height for a record. Removing it from totalKnownHeight and factoring it out of
averageRowHeight.
| Parameter | Type | Description |
|---|---|---|
records | Model | Model[] |
Refresh a single cell.
| Parameter | Type | Description |
|---|---|---|
record | Model | Record for row holding the cell that should be updated |
columnId | String | Number | Column id to identify the cell within the row |
Returns true if cell was found and refreshed, false if not
Releases all elements (not from dom), calculates how many are needed, creates those and renders
Rows
Gets the Row following the specified Row (by index or object). Wraps around the end.
| Parameter | Type | Description |
|---|---|---|
indexOrRow | Number | Row | index or Row |
Get the Row at a specified store index. Returns undefined if the row index is not rendered.
| Parameter | Type | Description |
|---|---|---|
index | Number |
Get Row for specified record id
| Parameter | Type | Description |
|---|---|---|
recordOrId | Model | String | Number | Record id (or a record) |
Found Row or null if record not rendered
Get a Row for either a record, a record id or an HTMLElement
| Parameter | Type | Description |
|---|---|---|
recordOrId | HTMLElement | Model | String | Number | Record or record id or HTMLElement |
Found Row or null if record not rendered
Get a Row from an HTMLElement
| Parameter | Type | Description |
|---|---|---|
element | HTMLElement |
Found Row or null if record not rendered
Scrolling & rendering
Rerender all rows
Renders from specified records row and down (used for example when collapsing a group, does not affect rows above).
| Parameter | Type | Description |
|---|---|---|
record | Model | Record of first row to render |
Renders from specified row and down (used for example when collapsing a group, does not affect rows above).
| Parameter | Type | Description |
|---|---|---|
fromRow | Row | First row to render |
Renders from the top of the grid, also resetting scroll to top. Used for example when collapsing all groups.