What is the recommended way to register a callback for when a component is registered.
An ‘afterRender’ listener would be ideal.
For example, if I wish to bind or sync views, how can I know when the view has been rendered?
What is the recommended way to register a callback for when a component is registered.
An ‘afterRender’ listener would be ideal.
For example, if I wish to bind or sync views, how can I know when the view has been rendered?
just found it:
onAfterRender
Spoke too soon, ‘onAfterRender’ executes every time the control is rendered.
What I need is a method with is only executed once, when the component is initialized. !
Oddly, you have an onDestruct, but no onCreate ??
This seems to work:
on: {'onAfterRender': webix.once(function (data) {
console.log('called once after first rendering:', data);
})},
Yep, there is no onCreate
As for onAfterRender - beware that components that are hidden will trigger this event only when they will become visible.