g_modal - Is there any documentation? What can we change in the modal dialog?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2021 12:57 AM
Hi, recently Im build a workspace for a new application using AES, and want to add a new UI action. So came across this g_modal that allow us to prompt confirmation or a form in dialog, but the documentation no where to be found except some blogs and article out there.
1. Does SNOW publish an official documentation how we can use g_modal?
2. How can I change the button title for the confirm button in g_modal.confirm?
3. or, how can i add some text between the title and the fields in g_modal.showFields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2022 02:49 AM
Hi,
You can try this:
In the below code these attributes are responsible for changing the Labels for 'Ok' and 'Cancel' buttons.
cancelTitle: getMessage('Cancel the Operation'), // changing the label of cancel button
confirmTitle: getMessage('Confirm'), // changing the label of Ok button
g_modal.showFields({
title: "Updating Server Short Description",
fields: fields,
size: 'lg',
cancelTitle: getMessage('Cancel the Operation'), // changing the label of cancel button
confirmTitle: getMessage('Confirm'), // changing the label of Ok button
cancelType: 'default',
confirmType: 'confirm'
}).then(function(fieldValues) {
g_form.setValue('short_description', fieldValues.updatedFields[0].value);
g_form.setValue('support_group', fieldValues.updatedFields[1].value);
g_form.setValue('due_in', fieldValues.updatedFields[2].value);
g_form.save();
});
Kind Regards,
Amitoj Wadhera
Please Mark helpful if this works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 04:49 AM
Hi,
This code might be helpful to you.
function onClick(g_form) {
g_modal.showFields({
title: getMessage('Confirmation'), // title of modal popup
instruction: getMessage('Do you want to cancel this Profile?'),
size: 'md',
cancelTitle: getMessage("No"),
confirmTitle: getMessage("Yes"),
cancelType: "default",
confirmType: 'confirm'
}).then(function(fieldValues) {
g_form.save();
});
}