David
David

Reputation: 4271

How to remove item from Panel

I have container, which have box,textfield and button. I am adding that container in one panel. When I am clicking on button I want to remove that container. Problem is, Container is removed but it not showing on UI.

My Code where I am removing container from panel.

 var panel = Ext.getCmp("ABC");
 var record = panel.items.items;
 var recordlength = record.length;

 for (var j = 0; j < recordlength - 1; j++) {
    if (record[j].Label == me.Label) {
      record.remove(me);
      panel.remove();
   }
}

Upvotes: 2

Views: 9482

Answers (2)

Zvi
Zvi

Reputation: 617

it works for me:

while (this.items.items[0]) {
  this.remove(this.items.items[0]);
}

Upvotes: 2

UDID
UDID

Reputation: 2423

As you say you are able to remove container then try this to update your panel.

panel.update();
panel.doLayout();

It will update your panel after removing item from that.

Upvotes: 5

Related Questions