Call class page function from element Event
You can Edit page class to add your custom functions.
To call these function in an element Event, for example, you may:
_ Add an attribute, for example (contextmenu) in the element and directly call the function:
this['my_custom_function']()
or
my_custom_function()
![](../__attachments/21004293/Capture%20d'%C3%A9cran%202023-10-27%20134319.png?inst-v=1a90f070-fe26-41dc-931e-98c768b55d69)
_ Add an Event component to the Element and fill it with (contextmenu). Add a CustomAction component as a child, call your custom function:
page['my_custom_function'](params);
![](../__attachments/21004293/Capture%20d'%C3%A9cran%202023-10-27%20135020.png?inst-v=1a90f070-fe26-41dc-931e-98c768b55d69)
You may need to add the following code to prevent default browser behaviour:
event.preventDefault();