问题
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