Callback ViewHelper <c:callback> 

ViewHelper that includes a JavaScript function.

Go to the source code of this ViewHelper: CallbackViewHelper.php (GitHub).

Arguments 

The following arguments are available for the callback ViewHelper:

key

key
Required

true

Type
string

Callback key

fileName

fileName
Default
''
Type
string

File name containing the JavaScript function

Examples 

With fileName attribute 

The JavaScript function must be in the given file name.

<c:item key="tooltip">
    <c:item key="callbacks">
        <c:callback key="label" fileName="EXT:sav_charts/Resources/Public/Callbacks/TooltipLabel.js" />
    </c:item>
</c:item>
Copied!

Child nodes 

The JavaScript function is provided in the child node.

<c:item key="tooltip">
    <c:item key="callbacks">
        <c:callback key="label">
            function(context) {
                return context.label + ' - ' + context.formattedValue + ' €';
            }
        </c:callback>        
    </c:item>            
</c:item>
Copied!