add a afterRender callback at runtime (i.e. without editing the rendering template)

23 views
Skip to first unread message

Emmanuel Catrysse

unread,
Nov 15, 2016, 6:04:30 AM11/15/16
to KnockoutJS
Hi
Is it possible to programmatically add an afterRender callback for a specific DOM node at runtime ?
More precisely: in a huge project (Magento 2), a block is designed as a ko component linked to a given template. This block is periodically AJAX-refreshed but I'd like to add some extra DOM elements every time the block is refreshed, but without editing nor overriding the component template. It'd be great if these extra DOM elements could also have bindings of their own.
Is this possible ?
Reply all
Reply to author
Forward
0 new messages