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 that you accept these cookies being set.

change icon based on another object
#7
Thanks admin
this is the code I used 
I used two for loop because first digit of the grp-addr changed
while the addresses are not in series there are some addresses in the for loop not used, is there any issue in this case?

Code:
$(function(){
  if (window.grp) {
    function listen(j,i) {
      grp.listen(j + '/7/' + i, function(object) {
        $('.acoff-' + j+'-'+i).toggleClass('acoff', object.value == false);
      });
    }
   
    for (var j = 11; j <= 12; j++) {
    for (var i = 7; i <= 55; i++) {
      listen(j,i);
    }
    }
  }
});

Another case:
some devices has to alarm objects, I added two additional classes like (off-40 off-41) but it didn't work as logic or, moreover when refresh the page its updated correct!
Is there a solution for this case
BR,
Best Regards,
Reply


Messages In This Thread
RE: change icon based on another object - by khalil - 22.06.2022, 11:59

Forum Jump: