ExtJS 按钮样式工具栏

发布于 2024-12-20 14:31:38 字数 984 浏览 1 评论 0原文

我想知道是否可以将按钮放入面板的工具栏中,但保留按钮的外观,就好像它只是在普通面板中一样。

例如,我希望按钮看起来像这样:

Button Style

但是,它看起来像这样:

工具栏按钮

非常感谢!

编辑

创建工具栏的代码:

xtype: 'toolbar',
        items:
        [
            {
                xtype: 'button',
                text: 'Select bounding box on map',
                id: 'bbBoxButton',
                icon: 'img/cross_cursor.gif',
                listeners: {
                    click: function(){
                        polygonControl.activate();
                    }
                }   
            }
        ]

创建常规按钮的代码:

{xtype: 'button',    id: 'bboxButton', text: 'Select bounding box on map', icon: 'img/cross_cursor.gif', listeners: {click: function(){polygonControl.activate()}}}

我相信我必须使用按钮的 cls 配置,但我似乎找不到合适的 css 类。

I was wondering if it is possible to put a button into a panel's toolbar but have it retain the look of a button as if it was just in a plain panel.

For example, i want the button to look like this:

Button Style

However, it looks like this:

Toolbar Button

Thanks so much!

EDIT

Code to create toolbar:

xtype: 'toolbar',
        items:
        [
            {
                xtype: 'button',
                text: 'Select bounding box on map',
                id: 'bbBoxButton',
                icon: 'img/cross_cursor.gif',
                listeners: {
                    click: function(){
                        polygonControl.activate();
                    }
                }   
            }
        ]

Code to create regular button:

{xtype: 'button',    id: 'bboxButton', text: 'Select bounding box on map', icon: 'img/cross_cursor.gif', listeners: {click: function(){polygonControl.activate()}}}

I believe I have to use the cls config for the button, but i cannot seem to find the appropriate css class.

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

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

发布评论

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

评论(2

病毒体 2024-12-27 14:31:38

我有完全相同的问题。为了解决这个问题,我将其传递到按钮中:

cls:'x-btn-default-small'

I had the exact same issue. To solve, I pass this into the button:

cls:'x-btn-default-small'
海的爱人是光 2024-12-27 14:31:38

将其添加

ctCls: 'x-btn-over'

到按钮配置中解决了我在 Ext 2.2.1 中的问题

Adding this

ctCls: 'x-btn-over'

to button config solved the issue for me in Ext 2.2.1

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