2012-01-10 81 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 
相關問題