javascript - Extjs 将按钮在容器中居中对齐

标签 javascript extjs

我有以下带有几个按钮的容器:

{
                    xtype : 'container',
                    width : 320,
                    layout : 'hbox',
                    cls : 'readable-form no-border',
                    labelSeparator : '',
                    ref : '../sendBackForm',
                    layoutConfig: {
                        padding:'5',
                        pack:'center',
                        align:'middle'
                    },
                    style : {
                        margin : 'auto'
                    },
                    items : [ {
                        xtype : 'button',
                        itemId : 'yes',
                        iconCls : 'save-button-icon',
                        text : 'Yes',
                        ref : '../../yes'
                    }, {
                        xtype : 'spacer',
                        width : 10
                    }, {
                        xtype : 'button',
                        itemId : 'checker',
                        iconCls : 'save-button-icon',
                        text : 'Back to checker',
                        ref : '../../checker'
                    }, {
                        xtype : 'spacer',
                        width : 10
                    }, {
                        xtype : 'button',
                        itemId : 'prebooker',
                        iconCls : 'save-button-icon',
                        text : 'Back to prebooker',
                        ref : '../../prebooker'
                    }, {
                        xtype : 'spacer',
                        width : 10
                    }, {
                        xtype : 'button',
                        itemId : 'cancel',
                        text : 'Cancel',
                        ref : '../../cancel'
                    }, {
                        xtype : 'spacer',
                        width : 90
                    }, {
                        xtype : 'button',
                        itemId : 'ok',
                        hidden : true,
                        text : 'Ok',
                        ref : '../../ok'
                    } ]

                }

问题是当我隐藏所有按钮并只想显示“确定”按钮时,它出现在窗口左 Angular 附近,我如何将其放置在窗口中间?

最佳答案

您是否尝试过在容器中添加以下代码? : autoEl: {tag: 'center'}

关于javascript - Extjs 将按钮在容器中居中对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19633403/

相关文章:

javascript - 带有 extjs 4.2 的文件字段,没有 fakepath

javascript - Ext Js 4 "white-space"仅适用于元素中的一个网格

Array inside Javascript Array - 如何调用子数组名称?

javascript - 使用 javascript/jquery/json/etc 获取国际时间

javascript - HTML 页面中的 VML/SVG 编辑器

javascript - jquery追加到未知的 parent

JavaScript/HTML - 警告框先于声音?

javascript - 无法构建 ExtJs 应用程序

javascript - ExtJs 与转换器的绑定(bind)(公式)

javascript - ExtJS 在已经添加的面板上方添加面板