Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS - Dynamically Format GridPanel rows?

Tags:

extjs

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.

like image 509
Scott Klarenbach Avatar asked Apr 06 '26 05:04

Scott Klarenbach


1 Answers

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' : '';
    }
}
like image 179
Brian Moeskau Avatar answered Apr 10 '26 03:04

Brian Moeskau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!