How to remove item from Panel

独自空忆成欢 提交于 2019-12-08 06:36:03

问题


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

回答1:


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.




回答2:


it works for me:

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


来源:https://stackoverflow.com/questions/38715954/how-to-remove-item-from-panel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!