【问题标题】:hasCls() not working for my Extjs GridhasCls() 不适用于我的 Extjs 网格
【发布时间】:2015-12-25 07:53:01
【问题描述】:

我正在为我的网格中的点击记录应用 css,如下所示

 listeners: {
    select: function(record,rowIndex) {
        this.getView().addRowCls(rowIndex, 'green');
    }}

我需要检查css是否存在的条件,我正在尝试这样检查

 select: function(record,rowIndex) {
        this.getView().addRowCls(rowIndex, 'green');
        if(this.getView().hasCls('green')){}
    }

总是返回 false。请帮帮我...

【问题讨论】:

    标签: extjs4.2


    【解决方案1】:

    您可以使用下面的方式来检查指定的CSS类是否存在。

    var row = this.getView().getNode(rowIndex, false);
    if (row) {
      console.log( Ext.fly(row).hasCls('green') );
    }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-14
      • 2016-01-03
      • 1970-01-01
      • 1970-01-01
      • 2014-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多