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.

Visibility or active/clickable by object status value
#1
Is try to active/show and desactivare/hide a command button icon on the basis of the status object value.
Ideally, the element is always visible (adding an On, active icon and an Off, passive/greyed icon), but only can be selected/activated/clicked when value of status object is true

I added JS, but doesn't seem to do the trick

$(function() {
  $('.hidden-by-value').each(function(_, el) {
    var addr = $(el).data('object');
    if (addr) {
      grp.listen(addr, function(obj) {
        var value = obj.value;

        $(el).css('visibility', if value {'visible'} else {'hidden'});
      });
    }
  });
});


Do I overlook something?
is 'object' correct? Or is this the main abject, and not the status object?

Thx
Don't ask what we can do in KNX but wonder what we can't - www.KNXlogic.eu
Reply


Messages In This Thread
Visibility or active/clickable by object status value - by cdebackere - 20.05.2022, 13:50

Forum Jump: