如何检查 extjs 中是否选中了复选框

How to check whether check box is selected or not in extjs?

本文关键字:是否 复选框 extjs 何检查 检查      更新时间:2023-09-26

我创建了一个面板。我在该面板中添加了一个复选框。我需要检查该复选框是否从外部功能选中。请任何人帮助我...

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

将这段代码放在你的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