Class ContextButtonMenuItem
java.lang.Object
com.vaadin.flow.component.charts.model.AbstractConfigurationObject
com.vaadin.flow.component.charts.model.ContextButtonMenuItem
- All Implemented Interfaces:
Serializable
- Since:
- 6.0.1
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetText()voidsetOnclick(String _fn_onclick) Sets the JavaScript function of theonclickoption, as the source code of the function.voidsetOnclickFunction(ChartFunction onclick) Sets the function of theonclickoption, declared in aJsDefinitioninterface.void
-
Constructor Details
-
ContextButtonMenuItem
public ContextButtonMenuItem()
-
-
Method Details
-
getText
-
setText
-
getOnclick
-
setOnclick
Sets the JavaScript function of theonclickoption, as the source code of the function.The browser compiles the function from this string, which a Content Security Policy without
unsafe-evalblocks: in the strict CSP mode, sending a chart configuration that has a function throws aContentSecurityPolicyViolationException.Setting a function this way clears a function set with
setOnclickFunction(ChartFunction), which works without compiling JavaScript in the browser.- Parameters:
_fn_onclick- the source code of the JavaScript function
-
getOnclickFunction
- See Also:
-
setOnclickFunction
Sets the function of theonclickoption, declared in aJsDefinitioninterface. The browser runs the function from the frontend bundle, so it works under a Content Security Policy withoutunsafe-eval.Setting a function this way clears a function set with
setOnclick(String).A chart exported to SVG with
SVGGeneratordoes not have the function. Neither does a chart state saved or restored withChartAiController.- Parameters:
onclick- the function, ornullto remove it- Since:
- 25.4
-