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.

How to Display 1-bit Object in New Visu + Change Shape Border Color via JavaScript
#1
Hi guys,
I’m working with the new Visu, and I’m struggling to understand how to display a 1-bit object.
Also, if possible, I need some help controlling the border color of the Shape widget using JavaScript. I want the border to turn green when the object at 32/1/6 is true, and red when it is false.
Screenshot attached.

Attached Files Thumbnail(s)
   
Reply
#2
(10.12.2025, 18:47)Fahd Wrote: Hi guys,
I’m working with the new Visu, and I’m struggling to understand how to display a 1-bit object.
Also, if possible, I need some help controlling the border color of the Shape widget using JavaScript. I want the border to turn green when the object at 32/1/6 is true, and red when it is false.
Screenshot attached.

I I figured out how to display  the 1bit ibject with choose switch widget and make it read only (big brain moment ...)
Reply
#3
To add a border depending on the switch value:

In Switch widget appearance set Additional CSS classes to switch-border

Add to Custom CSS:
Code:
.switch-border[data-value="true"] .compactmode {
  border: 1px green solid;
}
.switch-border[data-value="false"] .compactmode {
  border: 1px red solid;
}
Reply


Forum Jump: