I am trying to override window.confirm in ExtJS 4. Termination should return true or false (exactly the same as confirm, but with a great user interface).
window.confirm=function(msg) {var val=Ext.create("Ext.Window",{ title : 'Extra window!', width : 150, height: 100, closable : true, html : msg, modal : true, onEsc:aa, items:[ { xtype:'button', text:'Ok', handler:function() { return true; } }, { xtype:'button', text:'Cancel', handler:function(){ return false; } } ] }).show(); function aa(btn) { return false; }
I get a modal window wherever I use confirmation, but it does not return either true or false, it works asynchronously.
I tried with showModalDialog instead of confirming, this time, too, I am not getting the return value.
Is it possible to return true or false based on the user's choice (when the user selects ok and then returns true, false when clicking cancel)
source share