20.05.2022, 13:50
(This post was last modified: 20.05.2022, 14:02 by cdebackere.)
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
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