Search code examples
formsextjspopupwindowdestroy

ExtJs 3.4 Form in window don't wont reopen


I've got problem with reopen form in window In tool bar I've got button after click window with form show ups everything is ok but when i click cancle and try to reopen then only window shows without form

Form

addProductForm = new Ext.FormPanel({
            id: 'addFormID',
            width: 400,
            autoDestroy: false,
            autoHeight: true,
            frame: true,
            layout: 'form',
            monitorValid: true,
            items: [{..}]
             buttons: [
                {
                    text: 'Cancle',
                    handler: function () {
                        addProductForm.getForm().reset();
                        addFormWindow.hide();
                    }
                 }]
});

toolbar with window

tbar: new Ext.Toolbar({
                height: 30,
                width: 100,
                items: [{
                    xtype: 'button',
                    text: 'Add Product',
                    handler: function () {
                        addFormWindow = new Ext.Window({
                            id: 'addProductWindow',
                            title: 'Add Product',
                            closeAction: 'hide',
                            closable: true,
                            autoDestroy: false,
                            width: 400,
                            plain: true,
                            autoHeight: true,
                            modal: true,
                            resizable: true,
                            layout: 'fit',
                            items: [addProductForm]
                        });

                        addFormWindow.show();
                    }
                }]
            }),

Solution

  • Try removing ids from the components.