- 27 Sep 2023
- 1 Minute to read
- Print
- PDF
Changing the color of the FLIGHT STATUS with the script
- Updated on 27 Sep 2023
- 1 Minute to read
- Print
- PDF
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.
- Row template design mode
- Element script
Sample screen:
TUTORIAL STEPS:
A) Open the Simpleway template in Designer
| |
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
| |
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
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
| |
J) Click the Save & Publish button. Now the template is ready to be assigned and shown on your display. |