Reputation: 5078
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
Upvotes: 0
Views: 586
Reputation: 39
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
Upvotes: 0