0

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();
                    }
                }]
            }),
Dox
  • 158
  • 1
  • 10

1 Answers1

1

Try removing ids from the components.

dbrin
  • 15,525
  • 4
  • 56
  • 83
  • See this SO answer for more info: http://stackoverflow.com/questions/11872261/extjs4-1-up-down-versus-ext-getcmp/11874707#11874707 – dbrin Jun 17 '13 at 20:47