ExtJs panel - adding dynamic components

后端 未结 2 577
小蘑菇
小蘑菇 2021-02-14 01:19

I have a window with panel in inside the window. I add components to the panel dynamically. These components are in \'hbox\' layout so that they are arranged horizontally. On cl

相关标签:
2条回答
  • 2021-02-14 01:58

    I found the cause of the problem.

    Cause: when we add components with same 'id' to a panel, then the newly added component will get added to the top of the panel.

    Fix: Use 'itemId' instead of 'id' while adding same component to the panel.

    Hope this will be useful for someone.

    0 讨论(0)
  • 2021-02-14 01:58

    You can use insert method instead to specify the index of panel items that you want to put your component at:

    var index = panel.items.length;
    panel.insert(index, items);
    
    // or if it always going to be the second item
    panel.insert(1, items);
    

    Here it is in the docs.

    0 讨论(0)
提交回复
热议问题