如何检查extjs中的样式属性 [英] How to check the style properties in extjs
本文介绍了如何检查extjs中的样式属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检查extjs中的样式属性?
要将样式设置为面板,我们可以使用 setBodyStyle
。
设置样式后,我想检查特定属性的值。
喜欢,
var panel = Ext.getCmp('id');
if(panel.getStyles()。fontSize == 24)//例如
//做这个东西
else
//做其他的东西
我正在使用extjs 4.1.1a
解决方案
这些方法仅在Ext.dom.Element级别可用。意思是你需要调用
var panel = Ext.getCmp('id');
if(panel.el.isStyle('fontSize',24))//例如
//做这个东西
else
//做其他的东西
请在 Ext.dom.Element (您可以按样式过滤快速访问) / p>
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
解决方案
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)
这篇关于如何检查extjs中的样式属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文