2010-09-22 58 views
0

所以我宣布一个ExtJS单选按钮对象是这样的:从ExtJS的单选按钮访问值

.AddExtObject("{xtype:'radiogroup', ref:'../AndOr', defaults:{name:'rdo-payee2'}, width:120, items:[{boxLabel:'And', checked:true, inputValue:'and'},{boxLabel:'Or', inputValue:'or'}]}") 

当我这样做:

if (checkWin.Payee2.AndOr.getValue() == 'and') { 
       fundingRec.set('IsPayee2RequiredToSign', '1'); 
      } else { 
       fundingRec.set('IsPayee2RequiredToSign', '0'); 
      } 
      Global.alert(checkWin.Payee2.AndOr.getValue()); 

在我保存方法但是,它输出这样的:

[object Object] 

因此,fundingRec永远不会被设置为'1',因为它总是看到,值是我在上面的文本中d始终将其设置为“0”。

如何正确地访问此字段的值,因为我需要?

回答

1

我想通了。

如果您有ExtJS RadioGroup,您需要首先访问组中的无线电元件,然后获取该元素组值('和/或')..而不是基本值('true/false')。 ..like这

checkWin.Payee2.AndOr.getValue().getGroupValue()