ExtJS - Dynamically Format GridPanel rows?

点点圈 提交于 2020-01-02 07:42:29

问题


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.


回答1:


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' : '';
    }
}



回答2:


Nevermind:

view: new Ext.grid.GridView({
            getRowClass: function(rec, idx, rowPrms, ds) {
                return rec.data.isRead === false ? 'ph-bold-row' : '';
            }
        })


来源:https://stackoverflow.com/questions/3739479/extjs-dynamically-format-gridpanel-rows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!