一般checkboxgroup这个组建用在formpanel里,所以在formpanel渲染之前加入以下方法:
form部分:
items : [
{
xtype: 'checkboxgroup',
bind : {
fieldLabel : '{meal}'
},
items: [
{
bind : {
boxLabel: '{breakfast}'
},
name: 'breakfast',
inputValue : 1
},{
bind : {
boxLabel: '{lunch}'
},
name: 'lunch',
inputValue : 2
},{
bind : {
boxLabel: '{dinner}'
},
name: 'dinner',
inputValue : 4
},{
bind : {
boxLabel: '{snack}'
},
name: 'snack',
inputValue : 8
}
]
}
]
controller部分:
var formpanel = this.getView();
formpanel.getForm().findField('breakfast').setValue(true);
本文介绍如何在ExtJS框架中使用CheckboxGroup组件,并在表单渲染前设置特定选项为默认选中状态。通过formpanel和controller部分的代码配置实现。
7546

被折叠的 条评论
为什么被折叠?



