View Full Version : Accessing the components

7 Aug 2009, 4:23 AM
Hi experts,

I have a Panel which that has a xtype for a toolbar. In that toolbar there is a textfield. My question is, how can I access that textfield from that xtyped toolbar outside the Panel using a simple function?

7 Aug 2009, 4:55 AM
In Ext 3 a Toolbar is an Ext.Container, so you can use:

var field = panel.getBottomToolbar().getComponent('itemId-or-index-of-field');

(I recommend giving the field an itemId, because an index is dependent on the order you are showing the components on the toolbar)

7 Aug 2009, 10:09 AM
Thank you. I'll try that. :-)