Logic Machine Forum
Enable/Disable Widget Visualization by an 1bit Object - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Enable/Disable Widget Visualization by an 1bit Object (/showthread.php?tid=2661)



Enable/Disable Widget Visualization by an 1bit Object - HannPark - 29.05.2020

Hey Guys,  Big Grin

Hope everything´s good on these difficult days.

I write this thread looking for help cuz' I'd like to Show/Hide a Widget on my visualization by using an 1 bit KNX Object

Something like...

If KNXObject="True" then 
//Show Widget
Else
//Hide Widget
end

I know it´s not so easy as that Confused , but it´s kinda the main idea, if anyone can help me with that i'll be grateful

BR....


RE: Enable/Disable Widget Visualization by an 1bit Object - Daniel - 29.05.2020

https://forum.logicmachine.net/showthread.php?tid=869&pid=5041#pid5041


RE: Enable/Disable Widget Visualization by an 1bit Object - Erwin van der Zwart - 29.05.2020

Hi,

This is the original clean custom JS :
Code:
$(function(){
 grp.listen('1/1/1', function(object, state) {
    if (state == 'value' && object.value == true ) {
        $("#widget-1").removeClass("hide");
   } else if (state == 'value' && object.value == false ) {
        $("#widget-1").addClass("hide");
   }
  }, true);
});
BR,

Erwin