EXT 动态添加checkboxgroup的问题 10
varfp=newExt.FormPanel({frame:true,title:'模板管理→字段设置',id:'newFp',labelWidth:110,width:...
var fp = new Ext.FormPanel({
frame: true,
title:'模板管理→字段设置',
id:'newFp',
labelWidth: 110,
width: 600,
renderTo:'form-ct',
bodyStyle: 'padding:0 10px 0;',
items: [
{
xtype:'fieldset',
title: 'Checkbox Groups',
id:'fdset',
autoHeight: true,
layout: 'form',
items: [{
xtype: 'button',
text: '添加字段',
handler: function(){
var chkgroup = new Ext.form.CheckboxGroup({
fieldLabel: '省份',
id: 'chkgroup2',
columns: 3,
items: [{boxLabel: 'Item xx', name: 'cb-horiz-6'}]
});
Ext.getCmp('fdset').items.add(chkgroup)
Ext.getCmp('fdset').doLayout();
}
},{
xtype: 'checkboxgroup',
fieldLabel: '基本字段',
id:'expFieldGroup',
columns: 3,
items: [
{boxLabel: 'Item 1', name: 'cb-horiz-1'},
{boxLabel: 'Item 2', name: 'cb-horiz-2', checked: true},
{boxLabel: 'Item 3', name: 'cb-horiz-3'},
{boxLabel: 'Item 4', name: 'cb-horiz-4'},
{boxLabel: 'Item 5', name: 'cb-horiz-5'}
]
}]
}]
});
当点击添加字段按钮后,checkboxgroup是加入到fieldset中来的,但是只显示fieldLabel: '省份', 并没有显示添加的checkboxgroup中item,实在是搞不懂是什么原因,请各位帮帮忙 展开
frame: true,
title:'模板管理→字段设置',
id:'newFp',
labelWidth: 110,
width: 600,
renderTo:'form-ct',
bodyStyle: 'padding:0 10px 0;',
items: [
{
xtype:'fieldset',
title: 'Checkbox Groups',
id:'fdset',
autoHeight: true,
layout: 'form',
items: [{
xtype: 'button',
text: '添加字段',
handler: function(){
var chkgroup = new Ext.form.CheckboxGroup({
fieldLabel: '省份',
id: 'chkgroup2',
columns: 3,
items: [{boxLabel: 'Item xx', name: 'cb-horiz-6'}]
});
Ext.getCmp('fdset').items.add(chkgroup)
Ext.getCmp('fdset').doLayout();
}
},{
xtype: 'checkboxgroup',
fieldLabel: '基本字段',
id:'expFieldGroup',
columns: 3,
items: [
{boxLabel: 'Item 1', name: 'cb-horiz-1'},
{boxLabel: 'Item 2', name: 'cb-horiz-2', checked: true},
{boxLabel: 'Item 3', name: 'cb-horiz-3'},
{boxLabel: 'Item 4', name: 'cb-horiz-4'},
{boxLabel: 'Item 5', name: 'cb-horiz-5'}
]
}]
}]
});
当点击添加字段按钮后,checkboxgroup是加入到fieldset中来的,但是只显示fieldLabel: '省份', 并没有显示添加的checkboxgroup中item,实在是搞不懂是什么原因,请各位帮帮忙 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询