Reputation: 561
After creating buttons on a form with buttons: [{ }], which is meant to be shorthand for the whole docked item syntax, inspection shows that form.buttons is null, and the buttons only exist in form.dockedItems. Since .buttons is a Config, shouldn't they be able to be accessed that way? Would be a little easier than diving into docked items or am I being picky? :-) tia
Upvotes: 0
Views: 769
Reputation: 30082
You can use the down() selector to grab it:
Ext.require('*');
Ext.onReady(function() {
var panel = Ext.create('Ext.panel.Panel', {
renderTo: document.body,
width: 400,
height: 400,
buttons: [{
itemId: 'b1',
text: 'Foo'
}]
});
console.log(panel.down('#b1'));
});
Upvotes: 1