Extjs中嵌入Applet,其高度如何自动适应父组件
嵌入Applet的代码 index.jsp :
如图1:
[img]/upload/attachment/112060/7adf0c96-6031-3400-98fa-4637579bd5f6.jpg[/img]
中间插入的Applet高度上没有完全填充组件中
图2:
[img]/upload/attachment/112072/03fb3dee-7c87-3700-a29f-a5e7304d1eb4.jpg[/img]
浏览器大小变化时,父组件则出现右边滚动条;
请问各位,如何在高度上自动适应父组件?
我有个做法是这样的,不过是为ext组件动态赋宽高的,希望对你有帮助。
[code="java"]
var CurvePane = document.getElementById("CurvePane");
CurvePane.height = window.document.body.clientWidth;
CurvePane.width = window.document.body.clientHeight;
[/code]
上面代码在你页面加载的时候调用即可。
给组件加上属性autoHeight:true
在容器的render和resize事件中设置Applet对象宽高。