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.

Button disable
#2
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
Reply


Messages In This Thread
Button disable - by Pawel - 08.06.2016, 11:20
RE: Button disable - by Erwin van der Zwart - 08.06.2016, 19:24
RE: Button disable - by legolas2069 - 29.06.2018, 07:26
RE: Button disable - by Pawel - 09.06.2016, 06:37
RE: Button disable - by admin - 29.06.2018, 08:04
RE: Button disable - by legolas2069 - 03.07.2018, 10:25
RE: Button disable - by Thomas - 06.08.2018, 08:15
RE: Button disable - by Erwin van der Zwart - 06.08.2018, 10:55
RE: Button disable - by DGrandes - 17.12.2019, 12:48

Forum Jump: