3

I created one panel. I added one checkbox in that panel. I need to check whether that checkbox selected or not from outside function. Please any one help me....

this.currentManagerPanel = new Ext.Panel({
    border: false,
    width: 550,
    layout: 'fit',
    items: [{
        xtype: 'checkbox',
        name: 'isNewEmployee',
        height: 20,
        boxLabel: 'Is New Employee',
        inputValue: ''
    }]
});
Darin Kolev
  • 3,401
  • 13
  • 31
  • 46
user007
  • 613
  • 3
  • 10
  • 19
  • I got the answer. I changed instead of name property i provided id property and then i can read the value using Ext.getCmp("isNewEmployee").checked; Now it will return checkbox selected or not.. – user007 Jan 10 '12 at 13:03

2 Answers2

3
using Ext.getCmp("isNewEmployee").checked;
George G
  • 7,443
  • 12
  • 45
  • 59
hienvd
  • 346
  • 1
  • 5
  • 17
0

Place this code in your 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
George G
  • 7,443
  • 12
  • 45
  • 59