29.06.2018, 07:26
(08.06.2016, 19:24)Erwin van der Zwart Wrote: 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)
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
Hi Erwin, I know that this is a thread from a long time ago.
I tried your solution and it worked in PC visualization, but in Smartphone visualization, it disables the button but not the value button. Do you know how to disable it?
Regards,