View Full Version : Grid Header Menu

13 Mar 2012, 11:54 PM
Hi ,

I am very new to Extjs. I got to add more options for header menu along with sorting asc and desc. How to add?? Please give me an example for the same..

I got this solution in this forum by Condor

grid.on('viewready', function(){ grid.getView().hmenu.getComponent('asc').hide(); grid.getView().hmenu.getComponent('desc').hide();});But not getting where to add this. Tried adding after creation of grid but getting error in firebug "grid.getView is undefined" Please help me with this.

14 Mar 2012, 7:44 AM
You need to wait for the grid to render. Then you need to get the menu from grid.getView().hmenu and check to make sure it's valid. THen you should be able to add items to the menu.

19 Apr 2012, 12:51 PM
I am converting project from 3.2 to 4.0 and run into code where I need to add item to grid header. Originally it was done using hmenu, however, it does not work in 4.0. and I could not find any equivalent to it or any solution.
3.2 Code is like:

grid1.getView().hmenu.add('-',{itemId: 'Clmns', text: 'Columns', iconCls: 'x-cols-icon',
handler: function() { //some code }

Any ideas?