Facility Control

 View Only
  • 1.  How to dynamically change a button color

    Posted 02-14-2019 19:59
    I've got some buttons which fire salvos on my Ultrix routing system. I'd like to be able to set the button color to green if the salvo is active. I have a routine which checks the salvos in question to see if they are active I just don't know how to actually change the button color. Because the salvo being active can change for a number of reasons I can't just set up an on/off toggle button for the salvo, I need to be able to do it from anywhere in the panel source.

    Thanks!
    Erik


  • 2.  RE: How to dynamically change a button color

    Posted 02-14-2019 20:33
    Hi @Lanthade
    You're looking for ogscript.setStyle('ID_OF_BUTTON', 'UPDATED STYLE INFORMATION');

    In your case, it would be:
    ogscript.setStyle('ID_OF_BUTTON', 'bg#00FF00');

    Which would set the background colour of the button to bright green (hex color code 00FF00)
    #DashBoard


  • 3.  RE: How to dynamically change a button color

    Posted 02-15-2019 06:30
    @jamespeltzer Works great, thanks for the pointer!
    #DashBoard