0

I want to mark specific rows of my ListGrid with different background colors. My main issue is how to get List of ListGridRecord objects after data is retrieved from datasource. I use DataSource, and I have field defined in DataSource on which I will base decision how to color particular record.

I would iterate all ListGridRecord's after datasource returns data, and then use this attribute:

ListGridRecord.customStyle
azec-pdx
  • 4,790
  • 6
  • 56
  • 87
  • 1
    Check http://stackoverflow.com/a/16283333/2208271. Its possible to use other CSS attributes to set background color, etc. as well. – Sithsu Aug 15 '13 at 14:35

1 Answers1

0

You can use getCellCSSText or getBaseStyle like this :

getCellCSSText: function (record, rowNum, colNum) {
                if ((this.getFieldName(colNum) == "OBJ_NAME") || (this.getFieldName(colNum) == "OBJ_DESC")  || (this.getFieldName(colNum) == "OBJ_KIND_NAME") || (this.getFieldName(colNum) == "FATHER_NAME") ){
                    if (record.OBJ_ACTIVE == false) {
                        return "color:red;text-decoration:line-through;font-style:italic;";
                        }
                }
            }

Here is an example : http://smartclient.com/#replaceStyle

SBarney
  • 39
  • 1
  • 1
  • 11