10.10.2022, 11:19
I've used CSS to add labels in the past, however in this instance there are a lot of buttons (one for each light in the building / 50 or so per floor) so it would be preferable to dynamically add this based on the Custom Name applied to the object on this Widget.
Can't this be achieved by pulling this info from the data object on the page? I'm just not quite sure how to access the info from the object as yet.
I'm using the following javascript to dynamically hide buttons based on their value
Many thanks
Kind Regards
James
Can't this be achieved by pulling this info from the data object on the page? I'm just not quite sure how to access the info from the object as yet.
I'm using the following javascript to dynamically hide buttons based on their value
Code:
$(function() {
$('.hidden-by-value').each(function(_, el) {
var addr = $(el).data('status-object');
if (addr) {
grp.listen(addr, function(obj) {
var value = obj.value;
$(el).css('visibility', value ? 'visible' : 'hidden');
});
}
});
});
Many thanks
Kind Regards
James