问题
has anybody had the need to add an extra button to the grid panel header menu(sorting\columns)? potentially I would like to add another button to the menu that resets to the default columns model. I can accomplish this using Jquery but I was wondering if there is an EXTjs way to do it.
Thanks
回答1:
You need to dig through the source to see it's there, but a GridPanel has a view property which is its GridView which in turn has a hmenu property which is the menu it shows when you click on one of those column headers.
So, with a GridPanel called gridpanel (once it's rendered) you can do the following:
gridpanel.view.hmenu.add({
text: 'reset',
handler: function() {
// reset magicks
}
});
来源:https://stackoverflow.com/questions/4498217/how-to-add-an-extra-button-on-extjs-grid-header-menu