Called when object is refreshed.
onRefresh = function(event)
This event is common for all w2ui widgets (layout, grid, toolbar, sidebar, tabs, form).
You can add event listener during the object creation:
or after the object has been created:
The event handler is called before the default action of the event is triggered. You can cancel the default action by calling
. To perform an action
after the event is fully processed, define event.onComplete
page in utilities for more details.
Adding Custom Events for Generated Content
Normally, you should not add any events directly to generated content (grid, sidebar, etc), however, it is possible to do this. You can either
user inline html event <... onclick="..."> or you can add them with jQuery. You will need to add them in event.onComplete loop.
Layout, Sidebar, Toolbar, Tabs
For layout, sidebar, toolbar and tabs the refresh event will be triggered for each refreshed panel (node, item, tab). It differs from other widgets, but it seems to be necessary because for layout, sidebar, toolbar and tabs the refresh method takes an argument that specifies which panel, node, item or tab to refresh.