ExtJS radio的值获取

sirtener 2009-06-02 12:04:09
请问,在ExtJs框架中如何获取radio组中被选中的那项值,是否可以通过Ext.getCmp('radio名称').getValue()的方式获取......
...全文
5453 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
superfish0714 2012-10-30
  • 打赏
  • 举报
回复
你头像那女的怎么没胸啊?[Quote=引用 11 楼 的回复:]
引用 10 楼 woshinihaiyan 的回复:

引用 1 楼 myairland 的回复:
往后台提交数据前,首先通过getGroupValue获取单选框的值,这时创建的radio必须有inputValue值。

var v = radioPanel.form.findField("1").getGroupValue();

radioPanel.form.findField……
[/Quote]
Tony7777777 2012-08-17
  • 打赏
  • 举报
回复
{
id: 'ID_EditConfirmRadio',
xtype: 'radiogroup',
fieldLabel: '结果',
itemCls: 'x-check-group-alt',
columns: 1,
columnWidth: '.25',
items: [
{boxLabel: '准时', name: 'rb-col', inputValue: 0, checked: true},
{boxLabel: '延期', name: 'rb-col', inputValue: 1},
{boxLabel: '提前', name: 'rb-col', inputValue: 2},
{boxLabel: '不确定', name: 'rb-col', inputValue: 3}
]
}

// 结果
var ID_EditConfirmRadio = Ext.getCmp("ID_EditConfirmRadio").getValue();
alert(ID_EditConfirmRadio.getGroupValue());
wuxian1314520 2012-04-11
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
往后台提交数据前,首先通过getGroupValue获取单选框的值,这时创建的radio必须有inputValue值。

var v = radioPanel.form.findField("1").getGroupValue();

radioPanel.form.findField("1").setValue(v);
[/Quote]
不理想
blueskynet 2011-08-16
  • 打赏
  • 举报
回复
看下,是不是我想要的内容
a351780306 2011-07-04
  • 打赏
  • 举报
回复
拿分来了,
二线小黑 2011-05-01
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 woshinihaiyan 的回复:]

引用 1 楼 myairland 的回复:
往后台提交数据前,首先通过getGroupValue获取单选框的值,这时创建的radio必须有inputValue值。

var v = radioPanel.form.findField("1").getGroupValue();

radioPanel.form.findField("1").setValue(v);


用了
r……
[/Quote]
radioPanle 换成你定义的formPanel标识符
woshinihaiyan 2011-03-09
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 myairland 的回复:]
往后台提交数据前,首先通过getGroupValue获取单选框的值,这时创建的radio必须有inputValue值。

var v = radioPanel.form.findField("1").getGroupValue();

radioPanel.form.findField("1").setValue(v);
[/Quote]

用了
radioPanle 说未定义。 为啥
潜伏的猫 2010-09-16
  • 打赏
  • 举报
回复
好像还是不行啊~
xieyuankai 2010-08-17
  • 打赏
  • 举报
回复
必须要导入一个文件../ext-3.2.0/src/widgets/form/RadioGroup.js 导入之后xtype:'radiogroup',
style:'width:170px; display: block;text-align:right;line-height:22px;',
height:22,
width:164,
name:'txtSearchIsGrant',
id:'txtSearchIsGrant',
hideLabel:true,
columns:3,
vertical:false,
items:[
{
boxLabel:'所有',inputValue:'',name:'SearchIsGrant',checked:true
},
{
boxLabel:'是',inputValue:'1',name:'SearchIsGrant'
},
{
boxLabel:'否',inputValue:'0',name:'SearchIsGrant'
}
]

用SelectSearchIsGrant=Ext.getCmp('txtSearchIsGrant').getValue();获取即可
singerice 2010-08-02
  • 打赏
  • 举报
回复
顶,顶,顶
Meteoric_cry 2010-07-06
  • 打赏
  • 举报
回复
_formPanel.findByType("radiogroup")[0].getValue().inputValue
clojurer 2009-12-24
  • 打赏
  • 举报
回复
{ xtype:'radio',
boxLabel : '<span style="color:#04B404">付清</span>',
name : 'state1',
id:'state',
inputValue : 1
}, {
xtype:'radio',
boxLabel : '<span style="color:red">欠款</span>',
name : 'state1',
inputValue : 2,
checked : true
}
Ext.getCmp('state').getGroupValue()
ok 了.
重点:给第一个指定个ID
sirtener 2009-06-03
  • 打赏
  • 举报
回复
谢谢大家的提供的解决方案,我试过那种方式得不到radio被选中项的值.我是通过这种方式获取的

var mType = document.getElementsByName("medicalType");
var hCode = Ext.get('hosCode').dom.value;

var value;
for (var i=0; i<mType.length;i++){
if (mType[i].checked){
value = mType[i].value;
}
}


应该还有属于ExtJs的处理方式.希望能得到大家更多的帮助, 谢谢.
robyjeffding 2009-06-03
  • 打赏
  • 举报
回复
up up up!
xue08161981 2009-06-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 myairland 的回复:]
往后台提交数据前,首先通过getGroupValue获取单选框的值,这时创建的radio必须有inputValue值。

var v = radioPanel.form.findField("1").getGroupValue();

radioPanel.form.findField("1").setValue(v);
[/Quote]
支持楼主把,不让帖子沉下去
myairland 2009-06-02
  • 打赏
  • 举报
回复
往后台提交数据前,首先通过getGroupValue获取单选框的值,这时创建的radio必须有inputValue值。

var v = radioPanel.form.findField("1").getGroupValue();

radioPanel.form.findField("1").setValue(v);

81,095

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧