28.03.2017, 18:13
(This post was last modified: 28.03.2017, 23:02 by Erwin van der Zwart.)
Hi Cekca,
To make it read only change .addClass("hide") and .removeClass("hide") into .addClass('item-read-only') and .removeClass('item-read-only')
This sample uses the custom class 'lockbyknx' and adds a opacity of 50% to the image to indicate it's locked (:
BR,
Erwin
To make it read only change .addClass("hide") and .removeClass("hide") into .addClass('item-read-only') and .removeClass('item-read-only')
This sample uses the custom class 'lockbyknx' and adds a opacity of 50% to the image to indicate it's locked (:
Code:
$(function(){
grp.listen('1/1/1', function(object) {
if (object.value == true ) {
$(".lockbyknx").addClass("item-read-only");
$(".lockbyknx").find('img').css("opacity", 0.5);
} else if (object.value == false ) {
$(".lockbyknx").removeClass("item-read-only");
$(".lockbyknx").find('img').css("opacity", 1);
}
}, true); // set to true to send on same value
});
BR,
Erwin