bstras21
4 Jan 2012, 12:09 PM
I have a popup that contains an xtype and it works the first time but when I try to use it again after I destroy it, it's not recognized. I saw some posts on initComponent but I am using touch2 pr2. What is the best solution for this?
if (!popup) {var popup = Ext.create('Ext.Panel', {
fullscreen: true,
id:'mainPopup',
layout: 'card',
items:[{
xtype: 'PunchType'
},{
xtype:'panel',
docked:'bottom',
id:'listPanelButtons',
items:[{
xtype: 'button',
id: 'saveBtnPunch',
handler: function(){
localStorage.clear();
}
},{
xtype: 'button',
id: 'cancelBtnPunch',
handler: function(){
popup.destroy();
}
}],
},{
docked: 'top',
id:'topPopup',
html: description
}]
//}
});
}
if (!popup) {var popup = Ext.create('Ext.Panel', {
fullscreen: true,
id:'mainPopup',
layout: 'card',
items:[{
xtype: 'PunchType'
},{
xtype:'panel',
docked:'bottom',
id:'listPanelButtons',
items:[{
xtype: 'button',
id: 'saveBtnPunch',
handler: function(){
localStorage.clear();
}
},{
xtype: 'button',
id: 'cancelBtnPunch',
handler: function(){
popup.destroy();
}
}],
},{
docked: 'top',
id:'topPopup',
html: description
}]
//}
});
}