ExtJS - Dynamically Format GridPanel Rows?

I have entries with a boolean, and depending on the boolean, I would like the GridPanel rows to be in bold. I am sure there is a good way to style the GridView, but I cannot find it.

Thank.

+3
source share
2 answers

Your answer is correct, but I want to point out that there is no need to provide an instance of the GridView instance to override getRowClass. Use the GridPanel instead viewConfig:

viewConfig: {
    getRowClass: function(rec, idx, rowPrms, ds) {
        return rec.data.isRead === false ? 'ph-bold-row' : '';
    }
}
+8
source

Nevermind:

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

Source: https://habr.com/ru/post/1765380/


All Articles