sencha-touch - 如何获取 FieldSet 的元素

标签 sencha-touch extjs sencha-touch-2

我有一个 FieldSet :

Ext.define('admin.view.BuzzEditForm', {
    extend: 'Ext.form.Panel',
    requires: ['Ext.form.FieldSet','Ext.Img'],
    id: 'editorPanel',
    xtype: 'buzzEditForm',
    config: {
        /* modal: true,
         hideOnMaskTap: false,
         centered: true,
         width: 500,
         scrollable: false,*/
        items: [{
            xtype: 'fieldset',
            items: [
                {
                    xtype: 'textfield',
                    name: 'keyword',
                    label: 'Mots clés'
                },
                {
                    xtype: 'textfield',
                    name: 'title',
                    label: 'Titre'
                },
                {
                    id: 'editorPanelvisual',
                    xtype: 'field',
                    label: 'Visuel actuel',
                    component:
                    {
                        xtype: 'container',
                        layout: 'hbox',
                        items: [
                            {
                                id: 'buzzImageField',
                                flex: 1,
                                xtype: 'image',
                                src: 'http://pierre.chachatelier.fr/programmation/images/mozodojo-original-image.jpg',
                                height: 200
                            },
                            {
                                id: 'buzzChooseImageField',
                                xtype: 'button',
                                iconCls: 'arrow_right',
                                iconMask: true,
                                ui: 'action',
                                action: 'chooseBuzzImage'
                            }

                        ]
                    }

                },
                {
                    xtype: 'textfield',
                    name: 'visual',
                    label: 'Visuel'
                }
            ]
        }]
    }
});

我可以使用 Ext.getCmp('#editorPanel') 获取我的 formPanel,但是如何使用它的名称获取字段?

最佳答案

只需使用Ext.ComponentQuery,例如:

Ext.ComponentQuery.query('textfield[name="keyword"]')

更多详情,请查看:http://docs.sencha.com/touch/2-0/#!/api/Ext.ComponentQuery

关于sencha-touch - 如何获取 FieldSet 的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10603594/

相关文章:

sencha-touch - 如何使 dataview.list 在 Sencha Touch 2 中可见?

apache - 如何配置WAMP apache服务器允许ajax跨域请求?

javascript - ExtJS4:为什么当我在我的商店中使用 directFn 配置时,我需要将 directCfg.method 指定为 directFn 的属性

extjs - 如何在文本区域顶部对齐标签

css - 只为某些元素覆盖 CSS 选择器 - Sencha

javascript - Sencha Touch 2 上 Items[] 内的 tpl

extjs - 如何覆盖 extjs 中的文本字段组件并在应用程序中以多种形式使用它?

css - 自定义 ExtJS CSS - 一些困难

css - iOS sencha touch 中的列表元素填充

facebook - 带有 Facebook 身份验证的原生 Sencha Touch 应用程序