10

I am adding an item to Extjs panel.

this.add(new_el);
this.doLayout();

It works fine. but in some cases I have to add {new_el} at exact position, not last.

For example penultimate one.

Can't find easy method in Extjs 3.2.1

Darin Kolev
  • 3,401
  • 13
  • 31
  • 46
Lev Savranskiy
  • 422
  • 2
  • 7
  • 19
  • possible duplicate of [How to add an ExJs component at a specific position (index)?](http://stackoverflow.com/questions/6629363/how-to-add-an-exjs-component-at-a-specific-position-index) – Dave Dec 06 '12 at 23:09

1 Answers1

16

You should use insert() instead of add().

Mypanel.insert(0,cmp1);
Mypanel.insert(4,cmp2);
seba
  • 974
  • 2
  • 10
  • 30
vajrakumar
  • 758
  • 2
  • 7
  • 21