ExtJS Button Style Toolbar [duplicate]

与世无争的帅哥 提交于 2019-12-01 00:15:53

问题


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:

However, it looks like this:

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.


回答1:


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

cls:'x-btn-default-small'



回答2:


Adding this

ctCls: 'x-btn-over'

to button config solved the issue for me in Ext 2.2.1




回答3:


This link seemed to answer exactly what i wanted.

Look at zombeerose's response for 3.0 solution.

http://www.sencha.com/forum/showthread.php?57130-Toolbar-button-style



来源:https://stackoverflow.com/questions/8477879/extjs-button-style-toolbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!