求大虾帮忙:
extjs3的时候如果要为panel加载一个新的页面,可以写成
panel.load({
url:"xxx",
script:true
});
这样的方法去加载,但到了extjs4的时候发现该方法好像已经不好用了,如果我要动态为这个panel加载一个新的页面该如何做?
extjs3的时候如果要为panel加载一个新的页面,可以写成
panel.load({
url:"xxx",
script:true
});
这样的方法去加载,但到了extjs4的时候发现该方法好像已经不好用了,如果我要动态为这个panel加载一个新的页面该如何做?
var panel = Ext.create('Ext.Panel', {
id: 'myPanel',
title: 'Anchor Layout',
renderTo:Ext.getBody(),
loader:{ url: "/1.htm",autoLoad:true}//加载1.htm页面
});
});
<script type="text/javascript">
Ext.onReady(function(){
var form = Ext.create('Ext.form.Panel', {
border: false,
fieldDefaults: {
labelWidth: 55
},
renderTo:"out",
defaultType: 'textfield',
bodyPadding: 5,
items: [{
fieldLabel: 'Send To',
name: 'to',
anchor:'100%' // anchor width by percentage
},{
fieldLabel: 'Subject',
name: 'subject',
anchor: '100%' // anchor width by percentage
}, {
xtype: 'textarea',
hideLabel: true,
name: 'msg',
anchor: '100% -47' // anchor width by percentage and height by raw adjustment
}]
});
});
</script>
<div id="out" />
但我发现这样用loader根本没法加载1.html到我要的panel中去,请高手指教
loader: { url: "1.htm", autoLoad: true, scripts: true}//加载1.htm页面
Ext.onReady(function(){});
去掉上面的嵌套,即可显示