Skip to main content
Version: 8.1

Create a Proxy

You can create a JavaScriptProxy from a component's getJavaScriptProxy method.

proxy = component.getJavaScriptProxy(property)

Parameters

TypeParameterDescription
StringpropertyName of the component property to proxy. Each component has its own set of proxy-able properties.

Returns

JavaScriptProxy - A proxy for the JavaScript property.

Examples

# Zoom the chart to the specified range.
function = '(scale, range) => this.zoomScale(scale, range)'

# The keys of the arguments dictionary are mapped to the function argument names.
args = {
'scale': 'x',
'range': {
'min': 0,
'max': 10
},
}

# Get a proxy for an Embr-Charts Chart.js chart instance.
chart = self.getJavaScriptProxy('chart')
chart.runAsync(function, args)