PDA

View Full Version : Finding a field dynamically added to a paging toolbar



ferr
16 Nov 2007, 8:59 AM
I added a combo box to the paging toolbar of my grid, but I can't figure out how to add an on select handler to it. There does not seem to be an equivalent to the Form method of findField where I might do something like mypagingtoolbar.findField('mycombobox').on('select...etc.

How should I go about doing this? Is there an obscure config option I can set for the combo box? paging.add returns void but paging.addField (which is compatible with my combo box needs) return Ext.ToolbarItem.. I don't see any way in the API, but maybe there is something I can do with the returned object to add the event handler?

tryanDLS
16 Nov 2007, 9:08 AM
If you didn't keep a ref to the combo when you created it, you should be able to get it via Ext.getCmp(comboId), assuming you gave it an ID.

ferr
16 Nov 2007, 9:18 AM
Thanks, that's what I'm looking for and it works perfectly.