How to add an Extra button on Extjs grid header menu
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
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
}
});
精彩评论