Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXTJS close a window

I have a Window. I'm having some issues with the default close button which is on the top-right hand corner of the window. Therefore i was thinking to disable that close button and add a close button so that when the user clicks will disable/remove the window. What is the code to remove/close the Window.

The Window definition is as follows;

Ext.define('MyApp.view.MyWin', {
    extend: 'Ext.window.Window',
    alias: 'widget.mywin',
......
like image 815
Illep Avatar asked Dec 13 '12 22:12

Illep


1 Answers

It's just close().

Working example:

new Ext.window.Window({
    title: 'A window',
    closable: false, // hides the normal close button
    width: 300,
    height: 300,
    bbar: [
        {
            text: 'Close',
            handler: function () { this.up('window').close(); }
        }
    ],
    autoShow: true
});
like image 72
AndreKR Avatar answered Oct 04 '22 14:10

AndreKR