PDA

View Full Version : How to display menu with splitbutton in place of title in Panel header?



sowmyaranjan
27 Jun 2013, 8:44 AM
Hi,
I found lot of things interesting in ExtJs and its worth knowing this framework.While learning of ExtJs I found difficulty to display a menu with split button in place of Panel header title.

Is it possible to display menu with split-button in place of title in Panel header.How to listen to that menu click event.

I do not want to show menu on click of a tools button of Panel.

Please post the code if possible

.Appreciate any help on this.

Enjoy ExtJs......thank you!!!!

slemmon
30 Jun 2013, 4:25 PM
Take a look at the header config for panel:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.panel.Panel-cfg-header
That lets you pass in a config for a panel header. The panel header is a container which will allow you to pass in items such as a button:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.panel.Header-cfg-items



Ext.create('Ext.panel.Panel', {
width: 200,
html: '<p>World!</p>',
header: {
items: [{
xtype: 'button',
text: 'Header Button'
}]
},
renderTo: Ext.getBody()
});

sowmyaranjan
4 Jul 2013, 3:02 AM
Thanks a lot Slemmon...Its working