简体   繁体   English

ExtJS 4复选框

[英]ExtJS 4 checkbox

I can't find a way to on/off check box in runtime in my fieldset definition: 我在字段集定义中找不到运行时中打开/关闭复选框的方法:

       {
            xtype: 'fieldset',
            title: 'Do you want to add text file?',
            itemId: 'chorFileCheck',
            checkboxToggle: true,
            items: [
                {
                    xtype: 'filefield',
                    name: 'document',
                    fieldLabel: 'File',
                    labelWidth: 50,
                    allowBlank: false,
                    anchor: '100%',
                    regex: Portal.Const.DOC_ACCEPTED,
                    buttonText: 'Choose ...'
                }
            ],
            listeners: {

I can handle this check box by hand but can't find a way to do it in my code (make it in runtime). 我可以手动处理此复选框,但找不到在我的代码中执行此操作的方法(在运行时创建)。 Prompt me please how to do it. 请提示我该怎么做。

You need to use collapse() and expand() methods of fieldset to uncheck & check the checkbox respectively. 您需要使用fieldset的collapse()expand()方法分别取消选中选中复选框。

For Unchecking the checkbox: 对于取消选中复选框:

Ext.ComponentQuery.query("#chorFileCheck")[0].collapse();

For Checking the checkbox: 对于复选框的选择:

Ext.ComponentQuery.query("#chorFileCheck")[0].expand();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM