Search code examples
extjsextjs3

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();
   }
}

Solution

  • 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.