Changing the color of the FLIGHT STATUS with the script
  • 27 Sep 2023
  • 1 Minute to read
  • PDF

Changing the color of the FLIGHT STATUS with the script

  • PDF

Article summary

You may want different flight statuses to have their own font color, or background color. In this guide, we'll go through the steps of adding a script to Simpleway templates with a flight list that will do just that. As an example, we'll set different font colors for canceled and delayed flight statuses, and a separate color for all other statuses. 


Flight statuses in our Simpleway CX system are referred to as "Remarks". The Remarks tab is providing an overview of available flight remark values as integrated from AODB or new custom values added by the administrator, hence, you may have different names for remarks under the Name column on the Remarks tab and in this case you would have to adjust  the provided script to match the names of your own remarks. 

Topics covered
Templates tab
  • Row template design mode
  • Element script


Sample screen:


TUTORIAL STEPS:

A) Open the Simpleway template in Designer

  1. Open the Templates tab. 
  2. Select the Simpleway template which uses the List with flight status/remark element.



B) Click the Elements button and select the List element.
C) Click the row button of the selected List element in the Format editor.
D) Row templates subwindow
  1. Click the three dots button and select the Edit option. 





 
E) Click on the Elements button and select the Dynamic label element of the Remark (status).

F) Click the Edit element script button under Advanced section.



G) Edit script subwindow
  1. Type or copy the provided script to the Edit script field.
  2. Click the Save button.
Script:
if (get("target.targetInfo.remark") == "Cancelled") 
 setTextColor("#FF5733");
else 
 if (get("target.targetInfo.remark") == "Delayed") 
  setTextColor ("#FFD433");
 else setTextColor ("#FFFFFF");

Note:
In our example the names of remarks are "Cancelled" and "Delayed", replace them by your own remark names if they differ as defined on the Remarks tab.
Replace the setTextColor function by setBackground if you wish to change the background color of the text instead. 
You may also want to use Hex color codes of your own to fit the design of the template theme.
H) Click Save again, and then exit the subdesigner using the Back button.

I) Row templates subwindow 

  1. Select the row item.

J) Click the Save & Publish button. Now the template is ready to be assigned and shown on your display.




Was this article helpful?