6.2 Changing the panel background colour

A UDI can use UDI.setBackground() to change the background colour of its panel, typically as a way of notifying the user of an alert condition. For example:

// On some condition which evaluates as an alert…
UDI.setBackground("red");

The parameter for UDI.setBackground() can be any valid CSS background colour or style; it is directly setting the style.background of the HTML element which contains the indicator.

To remove a background, and revert to the app’s default, you simply pass an empty string:

// When the alert is cleared…
UDI.setBackground("");

Last updated