日期:2014-05-16 浏览次数:20740 次
{ id:'ipmac_mod', xtype: 'panel', layout: 'table', fieldLabel: '模式', defaultType: 'radio', isFormField: true, items: [ { id: 'type_local',name:'user_type',boxLabel: '模式1',value:'F',checked:editdata.data[0]['close_radius'], listeners: { check: function(radio,checked) { if(checked == true) { Ext.getCmp('radius').hide(); Ext.getCmp('local').show(); } } } }, { id: 'type_radius',name:'user_type',boxLabel:'模式2',value:'D',checked:editdata.data[0]['open_radius'], listeners: { check: function(radio,checked) { if(checked == true) { Ext.getCmp('local').hide(); Ext.getCmp('radius').show(); } } } } ] }
Ext.override(Ext.form.RadioGroup, { getValue: function(){ var v; if (this.rendered) { this.items.each(function(item){ if (!item.getValue()) return true; v = item.getRawValue(); return false; }); } else { for (var k in this.items) { if (this.items[k].checked) { v = this.items[k].inputValue; break; } } } return v; }, setValue: function(v){ if (this.rendered) this.items.each(function(item){ item.setValue(item.getRawValue() == v); }); else { for (var k in this.items) { this.items[k].checked = this.items[k].inputValue == v; } } } });
------解决方案--------------------
var type;//结果 var typeObj = Ext.getCmp("ipmac_mod"); if(typeObj){ for(var i =0;i<2;i++){ if(typeObj.items.items[i].checked){ type = typeObj.items.items[i].inputValue; } } }
------解决方案--------------------
var type_local=Ext.getCmp('type_local').getEl().dom ,type_radius=Ext.getCmp('type_radius').getEl().dom; if(type_local.checked)alert(type_local.value); else if(type_radius.checked)alert(type_radius.value); els