How to add an extra button to the Extjs grid header menu

Did anyone have to add an extra button to the grid header menu (sort \ columns)? potentially I would like to add another button to the menu that resets to the default column model. I can accomplish this with jquery, but I was wondering if there is an EXTjs way to do this.

thank

+3
source share
1 answer

You need to break through the source to see it there, but it GridPanelhas a property viewthat is it GridView, which in turn has a property hmenuthat appears in the menu that appears when you click on one of the column headers.

So, with GridPanel, called GridPanel(after displaying it) you can do the following:

gridpanel.view.hmenu.add({
  text: 'reset',
  handler: function() {
    // reset magicks
  }
});
+4
source

Source: https://habr.com/ru/post/1781414/


All Articles