PDA

View Full Version : Closing multiple tabs stops after first one



michiel
11 Mar 2010, 12:00 PM
Hi guys,

I'm experiencing something weird with closing multiple tabs. I have an array with id-numbers, with a for loop. And in this loop I check if there is a tabpanel with this id-number, if it's closable and then close it.

Now the weird thing is that after the first tab has closed, the for loop ends. Firebug doesn't show an error however.

See a code-snippet below:



var removed_items = new Array(1, 2, 3, 4);

for(i = 0; i < removed_items.length; i++) {
alert(removed_items[i]);
var item = Ext.getCmp('item'+section_id+'_'+removed_items[i]);
if(item) {
if(item.closable) {
Ext.getCmp('centertab'+section_id).remove(item);
}
}
}


Does anyone have a hint on how to start debugging, since firebug doesn't throw an error?

Thanks in advance. Michiel