onRender
is a custom Commerce Cloud binding that tells a function to run when an HTML element is being rendered on the page. The function is called in the current knockout context (typically bound to the widget, but certain knockout constructs, such as for each
, may alter the binding context). For example, when the following div
tag is rendered, the addEventHandlersForAnchorClick
function is called:
<div id="CC-customerProfile" data-bind="onRender: addEventHandlersForAnchorClick"> <!-- ... --> </div>