iframe嵌套ext grid宽度高度自适应

    grid = new Ext.grid.GridPanel({
        store: store,
        cm: cm,
        sm: cksm,
        renderTo:document.body,
        frame:false,
        width:document.body.clientWidth,
        loadMask: true,
        bbar:pagingBar,
	   view: new Ext.grid.GroupingView({forceFit:true,groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Documents" : "Documents"]})'})
    });
    grid.render();
    grid.on('rowdblclick',showDoc);
    store.load({params:{start:0, limit:25}});   
	store.on("load", function(){
		var frameHeight = grid.getFrameHeight();
		var innerHeight = grid.getEl().select('div.x-grid3-body');
		var gridHeight = innerHeight.first().getHeight() + frameHeight + 27;
		parent.document.getElementById("idIssueFrame").height=gridHeight; //重置iframe高度
		grid.setHeight(gridHeight); //重置gird高度
		return gridHeight;
	}); 

<iFrame id='idIssueFrame' align=center width=95% FRAMEBORDER=0 SCROLLING=NO src='grid.html'></iFrame>

你可能感兴趣的:(java,ext)