最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to check whether check box is selected or not in extjs? - Stack Overflow

programmeradmin3浏览0评论

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: ''
    }]
});

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: ''
    }]
});
Share Improve this question edited Aug 22, 2013 at 22:58 Darin Kolev 3,40913 gold badges33 silver badges47 bronze badges asked Jan 10, 2012 at 12:34 user007user007 6433 gold badges10 silver badges19 bronze badges 1
  • 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 Commented Jan 10, 2012 at 13:03
Add a ment  | 

2 Answers 2

Reset to default 3
using Ext.getCmp("isNewEmployee").checked;

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
发布评论

评论列表(0)

  1. 暂无评论