Methods
onCurrentPagesChanged(numPages)
Event handler that receives the notification that the number of logical pages has changed. The number of logical pages can grow or shrink because of addition or removal of rows and because of changes in the logical page size setting. By implementing this method it is possible, for example, to implement a dynamic page index to allow direct jump to each logical page.
Parameters:
Name | Type | Description |
---|---|---|
numPages |
Number |
The current total number of logical pages. |
onVisualUpdate(key, visualUpdate, domNode)
Event handler that is called by Lightstreamer each time a row of the
grid is being added or modified.
By implementing this method, it is possible to perform custom
formatting on the field values, to set the cells stylesheets and to
control the display policy.
In addition, through a custom handler, it is possible to perform custom
display actions for the row, by directly acting on the DOM element
containing the grid row.
This event is also fired when a row is being removed from the grid,
to allow clearing actions related to custom display actions previously
performed for the row. Row removal may happen when the DynaGrid
is listening to events from Subscription instance(s), and the first
Subscription it listens to is a COMMAND Subscription;
removal may also happen in case of AbstractWidget#removeRow or
AbstractWidget#clean execution and in case of destruction of
a row caused by exceeding the maximum allowed number of rows (see
DynaGrid#setMaxDynaRows).
This event is fired before the update is applied to both the HTML cells
of the grid and the internal model. As a consequence, through
AbstractWidget#updateRow, it is still possible to modify the current update.
This notification is unrelated to paging activity. New or changed
rows are notified regardless that they are being shown in the current
page or that they are currently hidden. Also, no notifications are
available to signal that a row is entering or exiting the currently
displayed page.
Parameters:
Name | Type | Description |
---|---|---|
key |
String |
the key associated with the row that is being added/removed/updated (keys are described in AbstractWidget). |
visualUpdate |
VisualUpdate |
a value object containing the
updated values for all the cells, together with their display settings.
The desired settings can be set in the object, to substitute the default
settings, before returning.
|
domNode |
Object |
The DOM pointer to the HTML row involved. The row element has been created by Lightstreamer, by cloning the template row supplied to the DynaGrid. |