bednee
9 Jan 2012, 6:56 AM
Is there a standard way how to add buttons and other stuff (input fields) into Ext.Panel header? The only way I could find is this:
var bla1 = new Ext.Panel({
collapsible : true,
html : 'Hello 1',
height: 50,
listeners : {
render : function(me) {
me.header.layout = 'hbox';
me.header.items.insert(0,'foo',Ext.create('Ext.Button',{
text: 'Test'
}));
me.header.doLayout();
}
}
});
For some reason, it wasn't possible to define this button using xtype, only Ext.create worked.
However, this way doesn't seem to be the right way to do it, but I didn't find anything better.
var bla1 = new Ext.Panel({
collapsible : true,
html : 'Hello 1',
height: 50,
listeners : {
render : function(me) {
me.header.layout = 'hbox';
me.header.items.insert(0,'foo',Ext.create('Ext.Button',{
text: 'Test'
}));
me.header.doLayout();
}
}
});
For some reason, it wasn't possible to define this button using xtype, only Ext.create worked.
However, this way doesn't seem to be the right way to do it, but I didn't find anything better.