Skip to content

Commit 07fe6e8

Browse files
authored
spModalSweetAlerts.js
spModal alerts are modern sweet alert to show the choices to be selected in an interactive way. Here, we are providing HR's to select the type of rewards in the modal page and populate a field with the selected value and show a message of the selected reward.
1 parent be1fd1a commit 07fe6e8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
function onChange(control, oldValue, newValue) {
2+
if (newValue == 'Yes') {
3+
spModal.open({
4+
title: "Reward Type",
5+
message: "Please select the category of Reward",
6+
buttons: [{
7+
label: "Star Performer",
8+
value: "Star Performer"
9+
},
10+
{
11+
label: "Emerging Player",
12+
value: "Emerging Player"
13+
},
14+
{
15+
label: "High Five Award",
16+
value: "High Five Award"
17+
},
18+
{
19+
label: "Rising Star",
20+
value: "Rising Star"
21+
}
22+
]
23+
}).then(function(choice) {
24+
if (choice && choice.value) {
25+
g_form.addInfoMessage('Selected Reward: '+ choice.label);
26+
g_form.setValue('reward_selected', choice.value);
27+
}
28+
});
29+
} else {
30+
g_form.clearValue('reward_selected');
31+
}
32+
}

0 commit comments

Comments
 (0)