Monday, October 8, 2018

Undocumented Alert() options - Confirmation label buttons

Normally, on a confirmation alert the two options are Confirm and Cancel.  You can change the labels on these two buttons with the code below.


app.alert.show('message-id', {
level: 'confirmation',
messages: message,
autoClose: false,
confirm: {
label: 'Yes'
},
cancel: {
label: 'No'
},
onConfirm: function () {
sessionStorage.setItem('s2s_teamLock', '1');
teamField.setPrimary(teamIndex);
sessionStorage.removeItem('s2s_teamLock');
sessionStorage.removeItem('s2s_teamArray');
}
,
onCancel: function () {
sessionStorage.removeItem('s2s_teamLock');
sessionStorage.removeItem('s2s_teamArray');
}
});
view raw record.js hosted with ❤ by GitHub

No comments:

Post a Comment