-
5 Nov 2008 7:57 PM #11
You are missing display:block;
Code:.ext-ux-grid-gridviewmenuplugin-menuBtn.x-grid3-hd-btn { background-image:url(btn.png); width:16px; display:block; } a.ext-ux-grid-gridviewmenuplugin-menuBtn.x-grid3-hd-btn:hover { background-position:-16px center; }
-
5 Nov 2008 8:57 PM #12
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
5 Nov 2008 10:01 PM #13
also found that moving repeating the following call
to in the plugin's init() method like soCode:this.menuBtn.dom.style.height = (this._view.mainHd.dom.offsetHeight-1)+'px';
works better for auto-configured grids (i.e. grid meta sent from the server).Code:this._view.on('refresh', function() { this.menuBtn.dom.style.height = (this._view.mainHd.dom.offsetHeight-1)+'px'; }, this);
solved by hooking into the gridview's onLayout() method.
complete override (including fix from previous post):
Code:Ext.override(Ext.ux.grid.GridViewMenuPlugin, { init : function(grid) { if (grid.enableHdMenu === true) { throw("Ext.ux.grid.GridViewMenuPlugin - grid\"s \"enableHdMenu\" property has to be set to \"false\""); } var v = this._view = grid.getView(); v.afterMethod('initElements', this.initElements, this); v.afterMethod('initData', this.initData, this); v.afterMethod('onLayout', this._onLayout, this); // auto-size plugin on view layout v.beforeMethod('destroy', this._destroy, this); this.colMenu = new Ext.menu.Menu({ listeners: { scope: this, beforeshow: this._beforeColMenuShow, itemclick: this._handleHdMenuClick } }); this.colMenu.override({ show : function(el, pos, parentMenu){ this.parentMenu = parentMenu; if(!this.el){ this.render(); } this.fireEvent("beforeshow", this); // show menu and constrain to viewport if necessary // ( + minor offset adjustments for pixel perfection) this.showAt( this.el.getAlignToXY(el, pos || this.defaultAlign, [Ext.isSafari? 2 : 1, 0]), parentMenu, true // true to constrain ); } }); }, _beforeColMenuShow : function(menu) { this._view.beforeColMenuShow.call(this, menu); // menu title tweak this.colMenu.insert(0, new Ext.menu.Separator()); this.colMenu.insert(0, new Ext.menu.TextItem({ text: String.format( '<img src="{0}" class="x-menu-item-icon x-cols-icon" />{1}', Ext.BLANK_IMAGE_URL, this._view.columnsText ), style: 'line-height:16px;padding:3px 21px 3px 3px;' })); }, /** * Hooks into the view's onLayout method and fits the menu to the grid header * @param vw * @param vh */ _onLayout: function(vw, vh) { this.menuBtn.dom.style.height = (this._view.mainHd.dom.offsetHeight - 1) + 'px'; } });Last edited by mystix; 13 Nov 2008 at 8:13 PM. Reason: update
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
6 Nov 2008 5:38 AM #14
-
6 Nov 2008 5:40 AM #15
-
6 Nov 2008 7:37 AM #16
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
6 Nov 2008 1:28 PM #17Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,170
- Vote Rating
- 33
Thorsten, awesome dude!!! Saved me from having to write it. Thanks :-D

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
8 Nov 2008 4:59 PM #18
-
9 Nov 2008 8:37 PM #19
for some strange reason this
causes my gridviewmenu to run off the bottom of my viewport when the menu list is too long, and subsequently causes a permanent mess-up of my layout until the browser is refreshed.Code:this.colMenu.show(t, 'tr-br?');
changing it to this
fixes the issue, but might be a weird place to have the menu displayed.Code:this.colMenu.show(t, 'tr-tl?');
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
9 Nov 2008 11:32 PM #20


Reply With Quote


