Confirm Mode
In
confirm mode, the modal works like an confirm dialog box. So you get to have an ok button and a
close button with default text set to "Ok" and "Close" respectively. You can customize the button through footer.okButton and footer.closeButton
option.
/**
* Confirm mode with default data ...
*/
ModalManager.instance.addModal({
body : {
content : `<span>Testing footer in <code>confirm</code> mode</span>`
},
footer : {
enabled : true,
mode : 'confirm',
onOk : function() {
this.hide();
}
}
});
/**
* Confirm mode + custom ok and close button text ...
*/
ModalManager.instance.addModal({
body: {
content: `<span>Testing footer in <code>confirm</code> mode, <br>with custom ok and close button text</span>`
},
footer: {
enabled: true,
mode: 'confirm',
closeButton: {
text: 'Close, or not?',
cssClass : 'thick-border',
iconClass : 'fa fa-fw fa-close'
},
okButton : {
text : 'Ok, good!',
cssClass : 'thick-border',
iconClass: 'fa fa-fw fa-close'
},
onOk : function() {
this.hide();
}
}
});