var completePanel = new Ext.FormPanel({
layout:"table",
height:390,
defaults:{
labelAlign: 'right',
layout:"form",
border:false,
labelWidth:30,
bodyStyle:"padding:1px"
},
layoutConfig:{
columns:6
},
items:[{
labelWidth:60,
items:[{
xtype:"label",
fieldLabel:"处理结果"
}]
},{
labelWidth:1,
items:[{
xtype:"radio",
checked:true,
inputValue:"1",
name:"result"
}]
},{
items:[{
xtype:"label",
fieldLabel:"成功",
labelSeparator:""
}]
},{
items:[{
xtype:"radio",
inputValue:"-1",
name:"result"
}]
},{
items:[{
xtype:"label",
fieldLabel:"失败",
labelSeparator:""//去掉label后面冒号
}]
},{width:100},{
colspan:6,
labelWidth:60,
items:[{
xtype:"textarea",
fieldLabel:"处理意见",
width:300
}]
}]
layout:"table",
height:390,
defaults:{
labelAlign: 'right',
layout:"form",
border:false,
labelWidth:30,
bodyStyle:"padding:1px"
},
layoutConfig:{
columns:6
},
items:[{
labelWidth:60,
items:[{
xtype:"label",
fieldLabel:"处理结果"
}]
},{
labelWidth:1,
items:[{
xtype:"radio",
checked:true,
inputValue:"1",
name:"result"
}]
},{
items:[{
xtype:"label",
fieldLabel:"成功",
labelSeparator:""
}]
},{
items:[{
xtype:"radio",
inputValue:"-1",
name:"result"
}]
},{
items:[{
xtype:"label",
fieldLabel:"失败",
labelSeparator:""//去掉label后面冒号
}]
},{width:100},{
colspan:6,
labelWidth:60,
items:[{
xtype:"textarea",
fieldLabel:"处理意见",
width:300
}]
}]
})
必须要定义成Ext.FormPanel 否者通过其他方式的获取不到
在items中定义value值也是无效的必须是inputValue 特别说明一下 inputValue的值不可以为0 否者会出现无法点击的现象
获取方式:var value = completePanel.getForm().findField("result").getGroupValue();
ok问题解决

本文介绍如何使用Ext JS库创建FormPanel实例,包括布局配置、表单元素定义及值的获取方法。特别强调了inputValue属性的重要性及其限制条件。
637

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



