首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >向fieldset字段添加公开

向fieldset字段添加公开
EN

Stack Overflow用户
提问于 2012-05-15 20:23:04
回答 1查看 1.1K关注 0票数 2

我有一个这样的字段集:

代码语言:javascript
复制
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: 'image',
                        src: '',
                        height: 200
                    }
                },
                {
                    xtype: 'textfield',
                    name: 'visual',
                    label: 'Visuel'
                }
            ]
        }]
    }
});

我想在我的editorPanelvisual字段中添加一个按钮。我该怎么做呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-05-15 20:31:26

这需要您对Ext.data.Field有更深入的了解

component是用于输入字段的特殊配置,默认情况下,它被设置为{xtype: "input", type: "text"},这是此解决方法的关键。使用flex配置扩展您的textfieldbutton宽度

试试这个:

代码语言:javascript
复制
{
    id: 'editorPanelvisual',
    xtype: 'field',
    component: {
      xtype: 'container', 
      layout: 'hbox', 
      items: [
      {
        xtype: 'textfield', 
        flex: 3,
      }, 
      {
        xtype: 'button', 
        flex: 1, 
        text: 'test'
      }
      ]},
},
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10600561

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档