I cannot see to get the buttons from an Ext.FormPanel defined like this:
Ext.apply({
....
buttons: [
{
text: 'Save',
itemId: 'btnSave'
}
]
});
I’ve tried getComponent on the FormPanel instance, but that doesn’t return btnSave. Is btnSave on a different element than the rest of the form?
You can’t use
getComponent()because the buttons are not part of theitemsconfig.getComponent() – “Examines this container’s items property and gets a direct child component of this container.”
You could give the button an
idand then useExt.getCmp()or use component query as @limscoder shows.