组合框放置在文本字段旁边使用extjs [英] Combo box placed next to the textfield using extjs

查看:160
本文介绍了组合框放置在文本字段旁边使用extjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码:

var mpanel = new Ext.Panel({
        baseCls: 'x-plain',
        //layout: 'anchor',
        width: 290,
        height: 500,
        items: [{
            {
                width: 140,
                border: 1,
                readOnly: true,
                value: "combovalue",
                style: {
                    borderColor: 'black',
                    borderStyle: 'solid',
                    float: 'left'
                },
                xtype: 'textfield',

            }, {

                name: 'comp',
                id: 'compId',
                bodyStyle: 'margin-left:140px'
                triggerAction: 'all',

                mode: 'local',
                store: new Ext.data.SimpleStore({

                    fields: [
                        'myId',
                        'displayText'
                    ],
                    data: [
                        [1, 'item1'],
                        [2, 'item2']
                    ]
                }),

                displayField: 'displayText',
                xtype: 'combo',

            }]
        })

这里我想要的宽度为140px的文本框,旁边我想放置组合框,所以我包括css边距-left:140px,但风格没有被追加。

here I want textfield of width 140px and next to it I want to place combobox so i have included css margin-left:140px but style is not getting appended.

如何解决这个问题?

推荐答案

HBox布局,放置文本框左(第一项)和组合权(第二项)。不要忘记删除您在css或style配置选项中放置的所有样式。

Wrap both fields in a HBox layout, place the textfield left (first item), and the combo right (second item). Do not forget to remove all styling you have put in css or "style" config option.

这篇关于组合框放置在文本字段旁边使用extjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆