NitrOuS
1 Dec 2010, 4:53 AM
I use the following code to check if a component exists and if this is true, remove it.
if (typeof (Ext.getCmp('myList')) != 'undefined')
{
MyNameSpace.myPanel.remove(Ext.getCmp('myList'), true);
MyNameSpace.myPanel.doComponentLayout();
}
The list and the panel are configured:
MyNameSpace.myList= new Ext.List({
fullscreen: true,
id: 'myList',
itemTpl: '<strong>{name}</strong>',
singleSelect: true,
grouped: true,
store: (MyNameSpace.Main.movieId === 1) ? MyNameSpace.cinemasStoreShort1 : MyNameSpace.cinemasStoreShort2,
indexBar: true
});
DemoEthniki.movieDetailsPanel = new Ext.Panel({
id: 'toolbartxt',
...
});
But this doesn't seem to work well, because after sometime the component is not removed and seems to be over another component. Any ideas? It is obvious that something I do wrong but what exactly? Thanks in advance
if (typeof (Ext.getCmp('myList')) != 'undefined')
{
MyNameSpace.myPanel.remove(Ext.getCmp('myList'), true);
MyNameSpace.myPanel.doComponentLayout();
}
The list and the panel are configured:
MyNameSpace.myList= new Ext.List({
fullscreen: true,
id: 'myList',
itemTpl: '<strong>{name}</strong>',
singleSelect: true,
grouped: true,
store: (MyNameSpace.Main.movieId === 1) ? MyNameSpace.cinemasStoreShort1 : MyNameSpace.cinemasStoreShort2,
indexBar: true
});
DemoEthniki.movieDetailsPanel = new Ext.Panel({
id: 'toolbartxt',
...
});
But this doesn't seem to work well, because after sometime the component is not removed and seems to be over another component. Any ideas? It is obvious that something I do wrong but what exactly? Thanks in advance