I have an external javascript library, which I have to use. The library is using ExtJS 6.6. This library has this code
var confirmationCallback = function(btn) {
if (btn == "yes") {
//do something
}
};
Ext.Msg.show({
title: 'Confirm Operation',
buttons: Ext.MessageBox.YESNO,
fn: confirmationCallback,
icon: Ext.MessageBox.WARNING,
msg: 'Are you sure?',
scope: this
});
My problem is that I need to do something when the user clicks No button and there is no handler for this in the library. They only handle Yes button. Also, I cannot modify this library because of license and many other reasons.
My question: Can I add No button handle somehow? I can only put my javascript code just before Ext.Msg.show call (there is a customisation point in the library at this place). I tried something like Ext.Msg.on("hide", console.log("hide listener")); and some other ways and it does not work. Ideally, it will be good to add my part at the end of their callback code. Or add my code to the hide/close event of the message box.