代码var main_panel = new Ext.Panel({
id : 'main_panel',
baseCls : 'x-plain',
renderTo : Ext.getBody(),
layout : 'table',
layoutConfig : {
columns : 2,
tableAttrs : {}
},
// applied to child
// components
defaults : {
frame : true,
width : 100,
height : 100
}
});
var xpanel = new Ext.Panel({
title : 'Item 1',
anchor : '20%' });
main_panel.add(xpanel); 执行上面的代码没有反应。我测试,直接在main_panel里面加入 items:[{title : 'Item 1',anchor : '20%'}] 是可以显示的。请问我在table布局的panel里面如何动态加入 items
id : 'main_panel',
baseCls : 'x-plain',
renderTo : Ext.getBody(),
layout : 'table',
layoutConfig : {
columns : 2,
tableAttrs : {}
},
// applied to child
// components
defaults : {
frame : true,
width : 100,
height : 100
}
});
var xpanel = new Ext.Panel({
title : 'Item 1',
anchor : '20%' });
main_panel.add(xpanel); 执行上面的代码没有反应。我测试,直接在main_panel里面加入 items:[{title : 'Item 1',anchor : '20%'}] 是可以显示的。请问我在table布局的panel里面如何动态加入 items
main_panel.add({
id : 'p_img' + (i + 1),
title : i + 1,
anchor : '20%',
items : [{
id : 'img' + (i + 1),
// hidden:true,
xtype : 'box',
width : 70,
height : 60,
style : '',
autoEl : {
tag : 'img',
src : imgSrc
// 指定url路径
})