PDA

View Full Version : Show a panel after it is detroyed



Kurt001
24 Mar 2011, 2:20 AM
Hi there,

I am using a popup and I would like to destroy after it was shown.

Here is my popup with a segmented Button (I reduced it to one button for this example):


App.mySeg = new Ext.SegmentedButton({
ui: 'normal',
xtype: 'segmentedbutton',
items:[{ui: 'normal',
width: 120,
xtype: 'button',
text: 'Close',
ui: 'confirm',
handler:function (){
App.mySeg.setPressed(1,false);
App.views.popup.destroy();
}
}
]
});

App.views.Popup = Ext.extend(Ext.Panel, {
floating: true,
centered: true,
modal: true,
width: 250,
height: 250,
style: 'background-color:#373737; color:white;',
styleHtmlContent: true,
html: '<div id="textPopUps">dummyText</div>',
dockedItems: [{
dock: 'top',
ui: 'myDark',
xtype: 'toolbar',
title: '<div id="namePopUps">Start</div>',
items: []
},{
dock: 'bottom',
ui: 'myDark',
xtype: 'toolbar',
layout: {
pack:'center'
},
items: [App.mySeg]
}]
});I create this panel with this call:

App.views.popup = new App.views.Popup();
App.views.popup.showBy('Contact');
Ext.fly('namePopUps').update('Contact');
Ext.fly('textPopUps').update('Contact information');After destroying the popup with

App.views.popup.destroy();
Creating the panel a second time will do without the dockedItems,
What am I doing wrong?

Best Kurt

jay@moduscreate.com
24 Mar 2011, 4:42 AM
You should not be configuring classes with complex configs like docked items as static properties in the prototype. That said, a new instance of App.mySeg should be created each time, and not referenced in your configuration as well.

Kurt001
24 Mar 2011, 5:22 AM
Could you show me how to get the desired result.
The code as is, shows neither the App.mySeg nor any other docked item.

Best Kurt