How to add an Extra button on Extjs grid header menu

不羁的心 提交于 2019-12-23 20:49:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!