Using onEsc function from window config

http://stackoverflow.com/questions/9552908/hwo-to-prevent-window-from-closing-on-esc-extjs-4

by Ramkumar Pillai

HTML

<link rel="stylesheet" href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/resources/css/ext-all.css">

JavaScript

Ext.create('Ext.window.Window', {
    title: 'Hello',
    height: 200,
    width: 400,
    layout: 'fit',
    onEsc: function() {
        var me = this;
        Ext.Msg.confirm(
            'Closing confirmation',
            'YOU REALLY WANTS TO close',
            function(btn) {
                if (btn == 'yes')
                    me.hide();
            }
            );
    },
    html: 'Dummy window'
}).show();