Extjs Grid - 单击行的单元格时将行添加到行 [英] Extjs Grid - Add class to row when click a cell of row

查看:287
本文介绍了Extjs Grid - 单击行的单元格时将行添加到行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击像
下方的网格单元格时,我想添加类到行中我试着三个选项但不工作。如何让它工作,谢谢

 听众:{
,'cellclick':function(grid,td,cellIndex,记录,tr,rowIndex,e,eOpts){
// addclass to row
Ext.fly(grid.getView()。getRow(rowIndex))。addClass('bluerow'); //不工作
grid.getView()。addRowCls(rowIndex,'bluerow'); //不工作
Ext.get(e.target).addClass('bluerow'); // not working
}
}


解决方案

cellclick中的

网格参数已经是view.Please看看 cellclick
您可以直接添加css为:




  grid.addRowCls(rowIndex,'bluerow'); 

以下是 小提琴


I want to add class to row when i click a cell of grid like below
I try three option but not working. How to make it work thanks

listeners: {
        ,'cellclick': function (grid, td, cellIndex, record, tr, rowIndex, e, eOpts ) {
            // addclass to row
            Ext.fly(grid.getView().getRow(rowIndex)).addClass('bluerow'); // not working
            grid.getView().addRowCls(rowIndex, 'bluerow'); // not working
            Ext.get(e.target).addClass('bluerow'); // not working
        }
}

解决方案

grid param in cellclick is already a view.Please have a look cellclick You can do add css directly as :

grid.addRowCls(rowIndex, 'bluerow');

Here is the fiddle

这篇关于Extjs Grid - 单击行的单元格时将行添加到行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆