将 style 属性与 ext.forms.combobox 一起使用

发布于 2025-01-04 12:35:14 字数 1148 浏览 2 评论 0原文

正在开发一个应用程序,其界面主要是用 EXT.JS 编写的 我在 ext.form.combo-box 方面遇到了麻烦...我正在尝试调整组合框的样式,但不确定样式属性是否有效并且我可以使用它,我尝试过但它不起作用对我来说,这是我的代码:

this.m_arriveByForm  = new Ext.form.ComboBox({
                id:             'trip-arrive-form',
                name:           'arriveBy',
                hiddenName:     'arriveBy',
        style:    {position:'relative', left:'12px'},   // style attribute i added
                fieldLabel:     this.locale.tripPlanner.labels.when,
                store:          this.m_arriveByStore,
                value:          this.m_arriveByStore.getAt(0).get('opt'),
                displayField:   'text',
                valueField:     'opt',
                anchor:         this.FIELD_ANCHOR,
                mode:           'local',
                triggerAction:  'all',

                editable:       false,
                allowBlank:     false,
                lazyRender:     false,
                typeAhead:      true,
                forceSelection: true,
                selectOnFocus:  true,

        });

当我仅添加一种样式规则时它会起作用,但如果我添加了不止一种样式规则,它就会停止工作,感觉就像 ayntax 错误,但你能帮助我吗?

am developing an application which its interface is mostly written in EXT.JS
am having a trouble with ext.form.combo-box...am trying to adjust the style of the combo-box,but am not sure if the style attribute is valid and i can use it, i tried it but its not working for me,here is my code:

this.m_arriveByForm  = new Ext.form.ComboBox({
                id:             'trip-arrive-form',
                name:           'arriveBy',
                hiddenName:     'arriveBy',
        style:    {position:'relative', left:'12px'},   // style attribute i added
                fieldLabel:     this.locale.tripPlanner.labels.when,
                store:          this.m_arriveByStore,
                value:          this.m_arriveByStore.getAt(0).get('opt'),
                displayField:   'text',
                valueField:     'opt',
                anchor:         this.FIELD_ANCHOR,
                mode:           'local',
                triggerAction:  'all',

                editable:       false,
                allowBlank:     false,
                lazyRender:     false,
                typeAhead:      true,
                forceSelection: true,
                selectOnFocus:  true,

        });

it works when i add only one style rule, ut if i added more than one then it stops working, feel like ayntax error but can u help me in this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

胡大本事 2025-01-11 12:35:14

您是否尝试过使用基本的 CSS 格式?

style: 'position: relative; left: 12px;'

而不是只是

style: { 
    position: 'relative',
    left: '12px'
}

我的一天结束的想法。

您似乎想要调整 ComboBox 的位置,我将通过配置包含 ComboBox 的组件的布局来做到这一点。但由于您只显示有关 ComboBox 的代码,我不知道该解决方案是否对您有帮助。

Have you tried using basic CSS formatting?

style: 'position: relative; left: 12px;'

instead of

style: { 
    position: 'relative',
    left: '12px'
}

Just my the end of the day idea.

You seem to want to adjust the position of the ComboBox and I would do that by configuring the layout of the component containing the ComboBox. But since you only show code concerning the ComboBox, I don't know if that solution will help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文