PDA

View Full Version : Getting the index of clicked column menu in grid header



Asken
27 Aug 2020, 6:10 AM
I've added a simple extra column to the grid. How do I know what column the menu is dropped down for?


columnMenu: {
xtype: 'menu',
align: 'tl-bl?',
hideOnParentHide: false,
items: {
remove: {
iconCls: 'x-fa fa-trash',
text: 'Remove',
handler: function (item) {
// how do I get the index of the column I clicked the menu for?
item.up('grid').fireEvent('deleteColumn', item);
},
},
},
},