|
|||||||
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
First of all, the autoScroll property on grid panel does not seem to be working. No matter what value I set it to, it does not seem to have any effect.
Secondly, why do horizontal scrollbars disappear as soon as autoHeight is set to true? It would seem that vertical scrollbars should disappear, but what if there are too many columns to view in the grid and there needs to be horizontal scrolling? Can anyone clarify if there is reason for the horizontal scrollbar disappearing too or if this is a bug? |
|
#2
|
||||
|
||||
|
maybe it'd be good if you could post your grid creation code?
also, some other details as per http://www.extjs.com/forum/showthread.php?t=13985 would be good. thanks.
__________________
3.x - ( Docs | Examples | SVN Log ) / 2.x - ( Docs | Examples ) HOWTO - ( Report Bugs | Post Proper Code ) / Learn / Saki's Examples Forum Search (FF/IE plugin) / API Search (FF/IE plugin) |
|
#3
|
|||
|
|||
|
- Happens in Ext r1225 from svn and both alpha 1 and beta 1 of 2.0.
- All browsers - Tested on ext-base - Tested on windows XP The code I use to generate the grid is wrapped inside a helper function for symfony, so it is rather complex, but the problem can be recreated using any of the examples you have on your website. I trimmed down this example to a basic grid to show this. Notice with the width set to 300 and autoHeight set to true, the Last Updated column gets cut off, but no horizontal scrollbars appear. The same thing happens if more columns get cut off. As soon as you specify a specific height, scrolls bars appear (both vertical and horizontal).
|
|
#4
|
||||
|
||||
|
Hi everyone... i've the same problem, when autoHeight in on orizontal scroolbar didn't appear!
I use Ext 2.0 final release. Any suggestion? |
|
#5
|
|||
|
|||
|
Is this an official bug? Any solution to this problem?
|
|
#6
|
||||
|
||||
|
bump
|
|
#7
|
||||
|
||||
|
Try the following override:
Ext.override(Ext.grid.GridView, {
layout : function(){
if(!this.mainBody){
return;
}
var g = this.grid;
var c = g.getGridEl(), cm = this.cm,
expandCol = g.autoExpandColumn,
gv = this;
var csize = c.getSize(true);
var vw = csize.width;
if(vw < 20 || csize.height < 20){
return;
}
if(g.autoHeight && !this.forceFit){
csize.height += this.scrollOffset;
}
this.el.setSize(csize.width, csize.height);
var hdHeight = this.mainHd.getHeight();
var vh = csize.height - (hdHeight);
this.scroller.setSize(vw, vh);
if(this.innerHd){
this.innerHd.style.width = (vw)+'px';
}
if(this.forceFit){
if(this.lastViewWidth != vw){
this.fitColumns(false, false);
this.lastViewWidth = vw;
}
}else {
this.autoExpand();
}
this.onLayout(vw, vh);
}
});
|
|
#8
|
|||
|
|||
|
Hi condor... for my project your fix doesn't work. The grid grow up of 40px every time you "paging" (move to the next avaiable page of the grid).
Waiting for an official fix (I hope!!), i've also overwrite the method layout to simulate the grid autoheight. Note that "simulate" grid autoheight, so you haven't to set autoheight:true on the grid setup. This is my code, any improvement or suggest is appreciate: layout : function(refresh){
if(!this.mainBody){
return; }
var g = this.grid;
var c = g.getGridEl(), cm = this.cm,
expandCol = g.autoExpandColumn,
gv = this;
var csize = c.getSize(true);
var vw = csize.width;
if(vw < 20 || csize.height < 20){return;}
if(g.autoHeight){
this.scroller.dom.style.overflow = 'visible';
}else{
this.el.setSize(csize.width, csize.height);
var hdHeight = this.mainHd.getHeight();
var vh = csize.height - (hdHeight);
this.scroller.setSize(vw, vh);
if(this.innerHd){
this.innerHd.style.width = (vw)+'px';
}
var actualRowHeight = this.mainBody.getHeight()+64; //scrollbar
c.setHeight(actualRowHeight);
this.el.setHeight(actualRowHeight);
this.scroller.setHeight(actualRowHeight-g.bbar.getHeight()-1); // -1 must be set here
}
if(this.forceFit){
if(this.lastViewWidth != vw){
this.fitColumns(false, false);
this.lastViewWidth = vw;
}
}else {
this.autoExpand();
}
this.onLayout(vw, vh);
}
|
|
#9
|
||||
|
||||
|
Quote:
Ext.override(Ext.grid.GridView, {
layout : function(){
if(!this.mainBody){
return;
}
var g = this.grid;
var c = g.getGridEl(), cm = this.cm,
expandCol = g.autoExpandColumn,
gv = this;
var csize = c.getSize(true);
var vw = csize.width;
if(vw < 20 || csize.height < 20){
return;
}
if(g.autoHeight){
csize.height = this.mainHd.getHeight() + this.mainBody.getHeight();
if (!this.forceFit) {
csize.height += this.scrollOffset;
}
}
this.el.setSize(csize.width, csize.height);
var hdHeight = this.mainHd.getHeight();
var vh = csize.height - (hdHeight);
this.scroller.setSize(vw, vh);
if(this.innerHd){
this.innerHd.style.width = (vw)+'px';
}
if(this.forceFit){
if(this.lastViewWidth != vw){
this.fitColumns(false, false);
this.lastViewWidth = vw;
}
}else {
this.autoExpand();
}
this.onLayout(vw, vh);
}
});
|
|
#10
|
|||
|
|||
|
Thanks condor. Very very good patch!
Works great! PS: i've only added 20px to csize.height due to a vertical scrollbar that appear (on scroller div) when go in editing mode. Yes, the paging toolbar is now 20px far to the last row... but solve my problem. If anyone have a suggest to resolve this.... ![]() |
![]() |
| Thread Tools | |
|
|