PDA

View Full Version : Best way to get a component from a... uhm... collection!



Crockford
8 Oct 2011, 12:24 AM
Hi guys,
I'm sure you know the toolbar component.


xtype: 'toolbar',
dock: 'bottom',
items: [{
text: 'More',
id: 'productAssistantMore'
}, {
text: 'Less',
id: 'productAssistantLess'
}]

what technic/style do you use to get a reference to an item?
Do you know an Ext native method to do something like toolbar.getItemById('productAssistantMore')?

Thank you in advance. Just now I'm looping trough the items collection but... i don't like that :)

Bye bye

twaindev
8 Oct 2011, 1:55 PM
toolbar.child('#productAssistantMore');
or

toolbar.down('#productAssistantMore');