This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Get group address when hover an element via Javascript
#1
Hi, I would like to know if someone know to get the related group address and group name of a visu element when I hover it.

I need to change a text via javascript, when i hover an element.

Thanks
Mirco
Reply
#2
Like this:
Code:
var addr = $(el).data('object');
var id = Scada.encodeGroupAddress(addr);
var obj = objectStore.getObject(id);
Reply
#3
It doesn't work like I want Sad 

Code:
$(".tooltip").mouseover(function(){
    var addr = $(".tooltip").data('object');
    var id = Scada.encodeGroupAddress(addr);
    var obj = objectStore.getObject(id);
});

this is my code, but if I have more visu element with Class "tooltip", this code give me the first group name of the first element that I hover

Someone can help me?
Reply
#4
No one that can help me? Please I need it!
Reply
#5
Replace second ".tooltip" with this
Reply
#6
Thank you! It works perfectly! Big Grin
Reply
#7
This is great feature! Would it be possible to limit the tooltip to Admin account and usermode only?
LM5Lp, firmware: 2018.08.22, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151
Reply
#8
For usermode only change selector to ".usermode .tooltip", as for admin-only see this example by Erwin: https://forum.logicmachine.net/showthread.php?tid=1145
Reply


Forum Jump: