-
3 Oct 2008 7:14 AM #11
Well, I needed to do a small edit to mystix code because of a 'this.grid has no properties' error and it does what I want it to do now.
Only setting enableHdMenu: false turns off the header button for the context menu completly. I think this is proper even with concern for grouping and other plugins as enableHdMenu: false currently takes care of enableColumnHide: false too. This doesn't require the GridView's headersDisabled config. columnMove and columnResize still work fine.
The main confusion my users were having was the header button was there and did nothing but throw a javascript error.
Code:Ext.override(Ext.grid.GridPanel, { initComponent : Ext.grid.GridPanel.prototype.initComponent.createSequence(function() { if (this.colModel) { this.colModel.grid = this; } }) }); Ext.override(Ext.grid.ColumnModel, { isMenuDisabled : function(col) { return ('undefined' != typeof this.grid) ? !this.grid.enableHdMenu : true || !!this.config[col].menuDisabled; } });
-
5 Mar 2009 6:31 AM #12MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
5 Mar 2009 7:08 AM #13
and the best part is -- i don't even remember this post.
anyways, +1 for this being fixed since i just encountered one thread in the help forum today where someone was trying to easily disable click-sorting on columns.
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
21 Aug 2009 8:05 AM #14
Here is an override for GridView so that if viewConfig{ headersDisabled: true} then drag and drop, resize, and the menu are disabled but you will still get a mouseover effect for sortable columns.
With grids enableHdMenu set to false you will still have drag and drop and resize but no menu and still get mouseover effect for sortable columns.
This should be used instead of the overide's for gridpanel and columnmodel above.
Code:handleHdOver : function(e, t) { var hd = this.findHeaderCell(t); if (hd) { this.activeHd = hd; this.activeHdIndex = this.getCellIndex(hd); var fly = this.fly(hd); this.activeHdRegion = fly.getRegion(); if (!this.cm.isMenuDisabled(this.activeHdIndex) && this.cm.isSortable(this.activeHdIndex)) { fly.addClass("x-grid3-hd-over"); if (!this.headersDisabled) { this.activeHdBtn = fly.child('.x-grid3-hd-btn'); if (this.activeHdBtn) { this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight - 1) + 'px'; } } } } }
-
11 Nov 2009 8:31 AM #15
trouble in the AIR
trouble in the AIR
Hi there,
that's all in ExtJS 2.2 and 2.0.2
I came across building a sample application with Ext and Adobe Air and it throws an error in the getCellIndex(hd) function while hovering over a grid's header element. I could debug it till that if the element is a header element it's within a div which doesn't have the colRe regexp defined class pattern (x-grid3-td- it should be x-grid3-hd-).
See (Case 2.0.2 )I've to correct myself after testing it in firefox(FF) as well. With firebug and AIR's introspector console I could figure out that while in FF the el.className includes x-grid3-td-0 so the AIR has only the x-grid3-td- as it's className attribute. Strange anywayCode:getCellIndex : function(el){ if(el){ var m = el.className.match(this.colRe); if(m && m[1]){ return this.cm.getIndexById(m[1]); } } return false;
partial Solution: As I didn't wanted to change the core I changed the ext-all-debug.js file regarding renderHeaders:
I changed p.id .. row forcing to convert the id to a string because webkit has problems with is in Template.js fileCode:renderHeaders : function(){ var cm = this.cm, ts = this.templates; var ct = ts.hcell; var cb = [], sb = [], p = {}; for(var i = 0, len = cm.getColumnCount(); i < len; i++){ p.id = cm.getColumnId(i) + ""; p.value = cm.getColumnHeader(i) || ""; p.style = this.getColumnStyle(i, true); p.tooltip = this.getColumnTooltip(i); if(cm.config[i].align == 'right'){ p.istyle = 'padding-right:16px'; } else { delete p.istyle; } cb[cb.length] = ct.apply(p); } return ts.header.apply({cells: cb.join(""), tstyle:'width:'+this.getTotalWidth()+';'});
r. SandorLast edited by carstep; 12 Nov 2009 at 7:41 AM. Reason: further checking
-
12 Nov 2009 8:59 AM #16
Hover from left and hit the first column on grid's header
Hover from left and hit the first column on grid's header
Hi,
I found another issue regarding header hovering. If it's the first header element and moving to the edge from left, probably outside of the grid, it checks if it's re-sizable but as it check for 'this.activeHdIndex -1' on 0 it will fail. My solution is as follow:
where thisCode:handleHdMove : function(e, t){ if(this.activeHd && !this.headersDisabled){ var hw = this.splitHandleWidth || 5; var r = this.activeHdRegion; var x = e.getPageX(); var ss = this.activeHd.style; if(( this.activeHdIndex > 0 ) && x - r.left <= hw && this.cm.isResizable(this.activeHdIndex-1)){ ss.cursor = Ext.isAir ? 'move' : Ext.isSafari ? 'e-resize' : 'col-resize'; }else if(r.right - x <= (!this.activeHdBtn ? hw : 2) && this.cm.isResizable(this.activeHdIndex)){ ss.cursor = Ext.isAir ? 'move' : Ext.isSafari ? 'w-resize' : 'col-resize'; }else{ ss.cursor = ''; } }
has been replaced withCode:if( x - r.left <= hw && this.cm.isResizable(this.activeHdIndex-1))
both in 2.0.2 and 2.2.xCode:if(( this.activeHdIndex > 0 ) && x - r.left <= hw && this.cm.isResizable(this.activeHdIndex-1))
r. SandorLast edited by carstep; 17 Nov 2009 at 5:06 AM. Reason: check in 2.2.x, language correction
-
29 Dec 2009 5:12 AM #17
Faced problem with handleHdOver in IE
Faced problem with handleHdOver in IE
Hi,
Currently facing problem in IE for column header menu drop down button.
In IE, when I row over any column header, the menu button appears at the last column.
It works fine in Mozilla FF.Code:handleHdOver : function(e, t){ var hd = this.findHeaderCell(t); if(hd && !this.headersDisabled){ this.activeHdRef = t; this.activeHdIndex = this.getCellIndex(hd); var fly = this.fly(hd); this.activeHdRegion = fly.getRegion(); if(!this.cm.isMenuDisabled(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'; } } } }
Verified that (this.activeHdBtn.id) is getting generated correctly.
Also could not figure it out how Ext manages to display the menu button using the line:
Did anyone came across such behavior?Code:this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight-1)+'px';
Thanks.
-
2 Mar 2011 11:22 PM #18
error in this.activeHdBtn.dom.style.height
error in this.activeHdBtn.dom.style.height
hi , I am getting this error in this.activeHdBtn.dom.style.height, when i moved mouse on grid panel header.I don't want to disable header, don't want to re sizable =false and don't want to stop drag and drop column on my grid. may be problem with (hd.firstChild.offsetHeight) . its value is 0 so -1px is being assign to activeHdBtnHeight.
this.activeHdBtn.dom.style.height=(hd.firstChild.offsetHeight-1)+'px';
-
2 Mar 2011 11:27 PM #19
and hd is getting by this var hd=this.findHeaderCell(t). so how i set the height of the firstchild set to 1.I am stuch in this very badly. is there any solution thanks
hd.firstChild.offsetHeight-1
this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight-1)+'px';


Reply With Quote

