Skip to content

Commit 8615d4c

Browse files
authored
Create HighlightPriorityField.js
1 parent f8120aa commit 8615d4c

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
function onLoad() {
2+
var priority = g_form.getValue('priority');
3+
var control = g_form.getControl('priority');
4+
5+
if (control) {
6+
switch (priority) {
7+
case '1': // Critical
8+
control.style.backgroundColor = '#ff4d4d';
9+
control.style.color = 'white';
10+
control.style.fontWeight = 'bold';
11+
break;
12+
case '2': // High
13+
control.style.backgroundColor = '#ffa500';
14+
control.style.color = 'black';
15+
control.style.fontWeight = 'bold';
16+
break;
17+
case '3': // Moderate
18+
control.style.backgroundColor = '#ffff66';
19+
control.style.color = 'black';
20+
control.style.fontWeight = 'bold';
21+
break;
22+
case '4': // Low
23+
control.style.backgroundColor = '#d3ffd3';
24+
control.style.color = 'black';
25+
control.style.fontWeight = 'bold';
26+
break;
27+
case '5': // Planning
28+
control.style.backgroundColor = '#e0e0e0';
29+
control.style.color = 'black';
30+
control.style.fontWeight = 'bold';
31+
break;
32+
default:
33+
control.style.backgroundColor = '';
34+
control.style.fontWeight = 'normal';
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)