PDA

View Full Version : How to add an component dynamically as first component?



anfla
12 Oct 2012, 2:31 AM
Heya, folks. A little question again:

I have multiple panels with a set of components.. Like this:



xtype: "panel",
items: [{
xtype: "button",
text: "foo"
},
{
xtype: "textfield",
value: "bar"
}]


But I need to add an component as first component during runtime, without overwriting the "foo"-button. Is this even possible?

willigogs
12 Oct 2012, 3:37 AM
Use the insert method:
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.Panel-method-insert