08.06.2016, 11:20
Is there any simple solution to make some button disabled via KNX telegram? Of course I can make svg file whit java script, but maybe there is a simple way.
Button disable
|
08.06.2016, 11:20
Is there any simple solution to make some button disabled via KNX telegram? Of course I can make svg file whit java script, but maybe there is a simple way.
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) Code: $(function(){ 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
09.06.2016, 06:37
Wow, this solution is outstanding. Simple and elegant it's opening new possibilities. Thanks Erwin.
29.06.2018, 07:26
(08.06.2016, 19:24)Erwin van der Zwart Wrote: Hi Pawel, 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,
29.06.2018, 08:04
Add to Custom JavaScript:
Code: $(function() { Add to Custom CSS: Code: .el-disabled {
03.07.2018, 10:25
(This post was last modified: 03.07.2018, 10:35 by legolas2069.)
Thanks admin I'll try it
EDIT: It worked! Thanks!
06.08.2018, 08:15
Hi
This code requires a new class for every dependant object. In case you have hundreds of objects you need to set readonly conditionally you have to create grp.listen('1/1/1', function(object, state) { $('.disabledbyknx_1').toggleClass('el-disabled', object.value == true); }); grp.listen('1/1/2', function(object, state) { $('.disabledbyknx_2').toggleClass('el-disabled', object.value == true); }); ... grp.listen('1/1/100', function(object, state) { $('.disabledbyknx_100').toggleClass('el-disabled', object.value == true); }); rows. Wouldn'd be there a nicer way? Like storing of the readonly maker object into comment of the main object?
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
06.08.2018, 10:55
Hi,
In case you have hundreds of them you can make a JS array with params for each object and a function to handle them, can be done with few lines of JS code.. BR, Erwin |
« Next Oldest | Next Newest »
|