PDA

View Full Version : Own option in grid popup



21 Nov 2013, 7:50 AM
Hi,


I have a grid.
By default, we know how to do sorting and column hiding .
In same popup i want to add my own option.(please see image, in red color box at last i want to add my option)


Can someone help how to do this?


Thanks,

troseberry
21 Nov 2013, 10:17 AM
Are you looking to add a new menu item available from all columns or just for a specific? Because they use a shared menu

21 Nov 2013, 9:08 PM
Hi Troseberry,

Thanks for reply,
I am looking to add a new menu item to all columns.


Thanks,
Pragyes

Piruthu
21 Nov 2013, 10:55 PM
Ext.create('Ext.grid.Panel', { // ...
listeners: {
afterrender: function() {
var menu = this.headerCt.getMenu();
menu.add([{
text: 'Custom Item',
handler: function() {
var columnDataIndex = menu.activeHeader.dataIndex;
alert('custom item for column "'+columnDataIndex+'" was pressed');
}
}]);
}
}
});
Credits to original solution here: http://stackoverflow.com/questions/10348581/add-a-custom-button-in-column-header-dropdown-menus-extjs-4

22 Nov 2013, 7:17 AM
Hi,

Thanks a lot,
it's work for me.