Ext.onReady(function () {
Ext.create('Ext.window.Window',{
autoShow:true,
width:950,
height:550,
layout:'absolute',
items:p2
});
var p2=Ext.create('Ext.panel.Panel',{
title:'test',
width:200,
height:200,
layout:'fit',
html:'inside Panel'
});
});
这样成功了,实现把p2嵌套进入windows中
为什么下面代码失败了呢
Ext.onReady(function () {
Ext.create('Ext.window.Window',{
autoShow:true,
width:950,
height:550,
layout:'absolute',
items:[{
title:'one',
xtype:'panel',
},{
title:'Two',
xtype:'panel',
width:400,
height:350,
items:p2 //这种方式是失败的
}]
});
var p2=Ext.create('Ext.panel.Panel',{
title:'test',
width:200,
height:200,
layout:'fit',
html:'inside Panel'
});
});
本文探讨了ExtJS框架中窗口与面板组件的嵌套使用方法,通过具体示例对比了成功与失败的代码片段,分析了组件配置及渲染过程中需要注意的问题。
1万+





