2012-01-10 85 views
2

我创建了一个面板。我在该面板中添加了一个复选框。我需要检查该复选框是否从外部函数中选择。请任何一个帮助我....如何检查复选框是否被选中或不在extjs中?

this.currentManagerPanel = new Ext.Panel({ 
    border: false, 
    width: 550, 
    layout: 'fit', 
    items: [{ 
     xtype: 'checkbox', 
     name: 'isNewEmployee', 
     height: 20, 
     boxLabel: 'Is New Employee', 
     inputValue: '' 
    }] 
}); 
+0

我得到了答案。我改变了而不是名称属性我提供的ID属性,然后我可以读取值使用Ext.getCmp(“isNewEmployee”)。现在它将返回复选框选择或不。 – user007 2012-01-10 13:03:50

回答

2
using Ext.getCmp("isNewEmployee").checked; 
0

将此代码放在您的controller.js

var form = win.down('form');       
var allFields = form.getForm().getFieldValues(); 
var value = form.getForm().findField('isNewEmployee').getValue(); 
// This will return True or False 
相关问题