PDA

View Full Version : IFRAME and Grid



Lloyd K
18 Oct 2007, 8:17 AM
Is there a work around for the render issue with a Grid in and iframe? Currently I create a bunch of ContentPanel with iframes on them and use tabs to switch between them, however sometimes they do not render and I think it's down to the issue as documented.

The work around I was hoping on was in the ContentPanel.activate event to call the Grid.getView().refresh() however this still doesn't fully work.

Are there any other ideas/ways?

mystix
18 Oct 2007, 9:03 AM
:-/ i'm lost (and i'm sure many others are too)... perhaps some details as per 8887 would be good?

Lloyd K
19 Oct 2007, 3:18 AM
Hi, I'm using extjs 1.1.1, the code is as follows:



pnl.setContent(["<iframe id='frame" + this.reportLayouts + "' style='height:100%;width:100%;border:none' src='report.aspx?" + qs + "&pnl=" + pnlEl + "&tm=" + (new Date().getTime()) + "'>"]);

pnl.on('activate', function(panel) {
var el = panel.getEl().dom.firstChild;

if (el) {
var frame = el.contentWindow;

if (frame) {
var layout = frame.reportLayout;

if (layout) {
var report = layout.iqReport;

if (report) {
var grid = report.grid;

if (grid) {
var view = grid.getView();

if (view) view.refresh(true);
}
}
}
}
}

//alert(panel.getEl().dom.childNodes.length);
//alert(panel.getEl().dom.firstChild.tagName);

});


Excuse the nested if's I should just really use if (!x) return; I guess.

The problem is, if there are multiple content panels all loading reports up in their own iframes, sometimes the grid doesn't render at all. Reading the documentation there is a mention of the visibility styles affecting Grids in Firefox and I think it's that which is the problem here.

My question is, is there a way around this as my current solution as you can see is to try and call refresh() when the content panel is activated however this doesn't always work either.