-
9 Sep 2008 7:49 AM #1
[2.2] Problems disabling grid columns menus
[2.2] Problems disabling grid columns menus
Hi,
I just upgraded to ExtJS 2.2 (from version 2.0) and have problems with the grid. Hovering over a column changes its title and show a menu. I don
-
9 Sep 2008 8:09 AM #2
why is this a bug?

the menus are disabled, aren't they?
the mouseover effect on the grid headers is merely a visual effect.
unless you've also disabled sorting on all your columns, i'd think you'd still want to indicate to users that they're hovering over an item which can be clicked, no?
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
9 Sep 2008 8:42 AM #3
I have disabled sorting on all my columns, and I don't want this visual effect. How do I get rid of it?
The current code doesn't show this visual effect for a column if the column has its menuDisabled property set to false (even if it is sortable), so it is related to menu displaying. What I
-
9 Sep 2008 10:20 AM #4
iirc setting defaultSortable:false on the grid's ColumnModel should do the trick.
my code's in the office so try that first and let me know if it works.
p.s. disabling the menu is a separate issue from disabling the column sorter, which is the header mouseover effect you're seeing -- neither should affect the other.
[edit]
found it. stick this viewConfig into your gridpanel:
note that this also disables column drag and drop.Code:// ... viewConfig: { headersDisabled: true // disable grid headers } // ...
still not a bug though -- although this particular GridView config is for a fact undocumented.
i'll make a mention of this in the doc bugs thread.Last edited by mystix; 9 Sep 2008 at 5:59 PM. Reason: edit
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
9 Sep 2008 9:53 PM #5
-
9 Sep 2008 10:37 PM #6
you might be right.
based on our discussion thus far, plus the new info from your last post, the handlerHdOver() method should probably be this instead:
[edit]Code:// specific to @splintor's case -- as @condor advised, it's still // advisable to use the GridView's headersDisabled config Ext.override(Ext.grid.GridView, { handleHdOver : function(e, t){ var hd = this.findHeaderCell(t); if(hd && !this.headersDisabled){ this.activeHd = hd; this.activeHdIndex = this.getCellIndex(hd); var fly = this.fly(hd); this.activeHdRegion = fly.getRegion(); // ensure the header menu is not disabled, and that the column is sortable if(!this.cm.isMenuDisabled(this.activeHdIndex) || this.cm.isSortable(this.activeHdIndex)){ fly.addClass("x-grid3-hd-over"); this.activeHdBtn = fly.child('.x-grid3-hd-btn'); if(this.activeHdBtn){ this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight-1)+'px'; } } } } });
and the isMenuDisabled() method also needs to be:
Code:// minor bugfix for existing ColumnModel.isMenuDisabled() method Ext.override(Ext.grid.GridPanel, { initComponent: Ext.grid.GridPanel.prototype.initComponent.createSequence(function() { if (this.colModel) { // give the ColumnModel a reference to this grid this.colModel.grid = this; } }) }); Ext.override(Ext.grid.ColumnModel, { isMenuDisabled : function(col){ return !this.grid.enableHdMenu || !!this.config[col].menuDisabled; } });Last edited by mystix; 9 Sep 2008 at 11:19 PM. Reason: final edit. tested with array-grid.js
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
9 Sep 2008 10:48 PM #7Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
I don't think that is a good solution.
Remember that column menus are also used for hiding and grouping (and plugins like filtering).
Your original suggestion was better. Set headersDisabled:false if you want to disable the menus for all columns or set menuDisabled:false for separate columns.
I see you changed your post again: I agree with the second change (but not the first one).
-
9 Sep 2008 10:51 PM #8
how about the latest code? was busy checking/editing while your were reading my last post

Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
9 Sep 2008 11:13 PM #9
alritey.. final edit.
found a bug in the 2nd chunk of code.
tested with the array-grid.js example.
[edit]
added notes to the first chunk of code in post #6 as per @condor's advice, which i also subscribe to.
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
10 Sep 2008 1:52 PM #10
OK, thanks for that.
For the time being, I guess I'll have to resort to add this line to my code:
splintorCode:MyColModel.isMenuDisabled = function() { return true; }


Reply With Quote