Hello,
i am working on an own Iciang Web 2 Module. Now i have problems with a quite simple thing. Or at least i thought it is simple.
In the view script of the module i want to define a text link which calls a JavaScript function (and do nothing more).
Remarks: The module has autorefresh activated.
The ways i tried it:
- Write onclick parameter in view script -> Is overwritten by Icinga Web 2 with its own click event.
- The url of the link get extra GET parameter, e.g.: execute_js=yes&uuid=XXXXX.
- The idea is that the controller can save the uuid from the last time before it has autorefreshed and knows then, if the parameter execute_js=yes is fresh or note.
- The problem here is, that the instance of the module controller is reinitializing on every autorefresh. So i can not store an old state in the instance.
- The JavaScript class in module.js is not reinitializing on every cycle:
- Rendered: is called on every render cycle
- initalized: is called only on initialisation.
- Thats fine, but what i need: a Function that is called on a specific click event.
Can someone give me a hint what i can try?
Best Regards
Matze