I have I view that extends Ext.grid.Panel
and I want to be able to ask the user if he really wants to close the panel after he clicks [X]. I tried with
listeners: {
beforedestroy: function() {
//console.log('In');
return false;
}
},
but obviously it's not that simple. Any ideas on how to prevent the closing of the panel?
Thanks
Leron
P.S.
This is what I get from sencha forums, haven't test it yet:
Ext.create( 'Ext.window.Window', {
title: 'test',
width: 200,
height: 200,
listeners: {
beforeclose: function( window ) {
Ext.Msg.confirm( 'Hey', 'Are you sure you want to close?', function( answer ) {
if( answer == "yes" ) {
window.destroy();
}
} );
return false;
}
}
} ).show();