PDA

View Full Version : Add a custom button in columnof a grid header menu.{EXTJS 4}



ravimaroju
6 Feb 2013, 2:48 AM
Hi

i want to add an extra button for specific column of grid header menu.
As we know each column have the 3 predefined Columns ('Sort Ascending', 'Sort Descending', 'Columns').

if i use this code the button is added to all the columns of grid header menu:


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');
}
}]);
}
}
});Please Tell me Any Suggestion would help me a lot..

Thanks