PDA

View Full Version : Button in Grid title bar



lazyProgrammer
7 Sep 2009, 4:49 AM
Hi,


Can we have menu button in the grid's header(title bar)? If yes, can someone plz provide example.

Condor
7 Sep 2009, 4:59 AM
You can use a 'tools' button and show a menu on click (aligned to the button).

lazyProgrammer
7 Sep 2009, 7:06 PM
Thanks for your reply,

The requirement is not to use the tool bar and place the menu button in the header or if possible then in between the toolbar(which has some other buttons) and grid header.

Any suggestion on this is appreciated.

Condor
7 Sep 2009, 11:02 PM
No, I don't mean a Toolbar. I was talking about the Ext.Panel tools config option.

Example:

var menu = new Ext.menu.Menu({
items: [{
text: 'Item 1'
},{
text: 'Item 2'
}]
});
var panel = new Ext.Panel({
title: 'Title',
width: 300,
height: 200,
tools: [{
id: 'gear',
handler: function(e, toolEl, panel, tc){
menu.show(toolEl, 'tr-br?');
}
}]
});

lazyProgrammer
9 Sep 2009, 12:23 AM
Thanks a lot ! It worked!

pinidbest
22 May 2012, 5:37 AM
This is wrong
You should use the showBy instead