08.06.2016, 19:24
(This post was last modified: 08.06.2016, 19:46 by Erwin van der Zwart.)
Hi Pawel,
Yes there is a much easier way (;
Create buttons like you used to and add into the additional class field this name 'disabledbyknx'
Copy and paste this code into your custom Javascript and change object address if needed. (use a bit object or code below will not work)
All the button(s) with the additional class name 'disabledbyknx' will fade for 50% and be unclickable on KNX object 1/1/1 with value 'true' and will be clickable and 100% visable again on value 'false'.
Have fun!
BR,
Erwin van der Zwart
Yes there is a much easier way (;
Create buttons like you used to and add into the additional class field this name 'disabledbyknx'
Copy and paste this code into your custom Javascript and change object address if needed. (use a bit object or code below will not work)
Code:
$(function(){
var ObjectAddress = Scada.encodeGroupAddress('1/1/1'); // Use 1 bit object !
objectStore.addListener(ObjectAddress, function(obj, type) {
if ( obj.value == true ) {
$(".disabledbyknx").css("opacity", 0.5);
$(".disabledbyknx").css("pointer-events", 'none');
} else {
$(".disabledbyknx").css("opacity", 1);
$(".disabledbyknx").css("pointer-events", 'all');
}
});
});
All the button(s) with the additional class name 'disabledbyknx' will fade for 50% and be unclickable on KNX object 1/1/1 with value 'true' and will be clickable and 100% visable again on value 'false'.
Have fun!
BR,
Erwin van der Zwart