【问题标题】:How to check the style properties in extjs如何检查extjs中的样式属性
【发布时间】:2013-02-07 12:51:58
【问题描述】:

如何查看extjs中的样式属性?

要为面板设置样式,我们可以使用setBodyStyle。 设置样式后,我想检查特定属性的值。

喜欢,

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

我使用的是 extjs 4.1.1a

【问题讨论】:

    标签: extjs extjs4 extjs4.1


    【解决方案1】:

    这些方法仅适用于 Ext.dom.Element 级别。这意味着您需要致电

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

    请查看 Ext.dom.Element 的 API(您可以按“样式”过滤以便快速访问)

    【讨论】:

    猜你喜欢
    • 2011-05-29
    • 1970-01-01
    • 2013-09-09
    • 2017-04-19
    • 1970-01-01
    • 2021-08-05
    • 2013-11-03
    • 2012-11-23
    相关资源
    最近更新 更多