PDA

View Full Version : [2.0a1][SOLVED] GridView bug in IE7 with iframe



vamsee.k
9 Oct 2007, 8:32 PM
Hi,

I am using extjs 2.0 alpha in an aspx (ASP.NET 2.0) file (with doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">).

The aspx file has a tab panel (2 tabs) with a grid in each tab. The page works fine when viewed independently. But when I use it inside an iframe, I get an 'Invalid argument' error when I click on another tab. After some debugging in VS.NET, I found the problem to be in Ext.grid.GridView.layout method. The following code is from the layout method:


var c = g.getGridEl(), cm = this.cm,
expandCol = g.autoExpandColumn,
gv = this;

var csize = c.getSize(true);
var vw = csize.width;

The vw value is -2 when the page is rendered inside an iframe. Further down in the method, there is this statement:

this.innerHd.style.width = (vw)+'px';
Since vw is negative, setting the style.width to the above value is throwing the 'Invalid argument' error. As a temporary fix, I added a check like this:


var vw = csize.width;
if(vw < 0) { vw = 0; }

A better fix would probably be to investigate why c.getSize(true) returned negative values for width and height (probably something to do with scroll bar width assumptions?).

It would be nice if the negative check is added in the extjs 2.0 codebase.

Note: This problem is only with IE7 (and that too only if its inside an iframe). It works perfectly fine with IE6 and firefox.

Environment:
ext-base.js
windows xp prof with SP2 (ver 5.1.2600) on x32
browser: IE7 ver 7.0.5730.11 (update ver: 0; 3283; )


Thanks,
Vamsee

jack.slocum
9 Oct 2007, 8:50 PM
Thanks for the detailed report. This has already been fixed in SVN.

http://extjs.com/forum/showthread.php?t=14251