How to check the style properties in extjs

戏子无情 提交于 2020-01-05 07:40:49

问题


How to check the style properties in extjs?

To set a style to a panel, we can use setBodyStyle. After setting the style, I want to check the value of a particular property.

Like,

var panel = Ext.getCmp('id');
if(panel.getStyles().fontSize == 24) //for example
    //do this stuff
else
    //do the other stuff

I am using extjs 4.1.1a


回答1:


These methods are only available on Ext.dom.Element level. Meaning you will need to call

var panel = Ext.getCmp('id');
if(panel.el.isStyle('fontSize', 24)) //for example
    //do this stuff
else
    //do the other stuff

Please se the API for Ext.dom.Element (you may filter by 'style' for quick access)



来源:https://stackoverflow.com/questions/14751580/how-to-check-the-style-properties-in-extjs

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