ExtJS - 动态格式化GridPanel行? [英] ExtJS - Dynamically Format GridPanel rows?
本文介绍了ExtJS - 动态格式化GridPanel行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢。
解决方案
您的答案是正确的,但我想指出,为了覆盖getRowClass,不需要提供一个实例化的GridView实例。使用GridPanel的 viewConfig
:
viewConfig:{
getRowClass:function(rec,idx,rowPrms,ds){
return rec.data.isRead === false? 'ph-bold-row':'';
}
}
I have records with a boolean value, and depending on the boolean value, I would like the GridPanel's rows to be rendered bold. I'm sure there is a nice GridView style way to do this but I can't seem to find it.
Thanks.
解决方案
Your answer is correct, but I want to point out that there's no need to provide an instantiated GridView instance in order to override getRowClass. Use the GridPanel's viewConfig
instead:
viewConfig: {
getRowClass: function(rec, idx, rowPrms, ds) {
return rec.data.isRead === false ? 'ph-bold-row' : '';
}
}
这篇关于ExtJS - 动态格式化GridPanel行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文