![]() |
|
html widget + custom js + grp library - Printable Version +- LogicMachine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Visu (https://forum.logicmachine.net/forumdisplay.php?fid=24) +--- Thread: html widget + custom js + grp library (/showthread.php?tid=6201) |
html widget + custom js + grp library - Andrea Becagli - 01.12.2025 Hi, I was trying to create a cool widget for battery charging, and the widget seems to be working when I change values manually from JavaScript, but if I try to read a group object, it does not do anything, so I tried Code: console.log(typeof grp )And I can see in the console that grp is undefined. Is there another way in Visu to get hold of group addresses? Or is GRP still not available to use in the new visu? I am using firmware 20251120 and visu 20251121 RE: html widget + custom js + grp library - admin - 04.12.2025 See this: https://kb.logicmachine.net/misc/visu/#localbus-library RE: html widget + custom js + grp library - kavorca - 08.12.2025 Hey! Not sure if this is the right place to put my comment. Found this thread and id like to ask where to put the javascript. I can only get it to work inline in the html part when creating a custom html widget in the visu admin. Is there another place i should place it? edit: Found the solution, it was in the top right corner of the visu editor. Also custom javascript cannot run when inside the editor/admin. Need to be in the visu app! RE: html widget + custom js + grp library - anve - 08.12.2025 (04.12.2025, 07:49)admin Wrote: See this: https://kb.logicmachine.net/misc/visu/#localbus-library Do you have an example of how to make a html widget that shows group adress 1/2/0 value? and updates it automatically when the object is updated? RE: html widget + custom js + grp library - admin - 11.12.2025 Here's a similar example that can be modified to display a value: https://forum.logicmachine.net/showthread.php?tid=3789&pid=40374#pid40374 RE: html widget + custom js + grp library - Andrea Becagli - 11.12.2025 (04.12.2025, 07:49)admin Wrote: See this: https://kb.logicmachine.net/misc/visu/#localbus-library Thanks admin I am now having a different problem: once I load a page with custom JavaScript, everything works fine, but if I change plan and then come back to the original plan then it does not execute the JavaScript functions anymore, and I need to refresh the web page to get them to work again as intended. Is there a way to fix it? RE: html widget + custom js + grp library - admin - 11.12.2025 See the example in my previous post. Your code must listen to widget-ready / widget-hide events. Unlike old Visu, widget elements only exist if the plan is visible. When switching to a different plan all widgets are removed. |