I'm using the Kendo UI grid in my AngularJS application and I would wish to apply a certain background color conditionally. Below is my column definition :
columns: [
{ field: "TradeAmount", title: "Trade Amount", width: "120px", filterable: { cell: { showOperators: false } } },
]
So the above column is bound to the 'TradeAmount' field of the data source. Now I have another field named 'ApprovalStatus' in my data source which can have value as 'Approved' or 'Unapproved'. Based on this value I wish to change the background color for cells in the column; Green for Approved and Red for Unapproved. Could someone help me out with that please.
Screenshot for @pankajparkar solution http://dojo.telerik.com/oREDI:
You could do this by using
template
option on field withng-style
directive.Small Demo here
Update
For getting changes to be done on
td
element you need to apply it using the directive currently it is getting applied on the span which you are specifying in the templeateAbove directive will set
background-color
property insidetd
which is parent of specified templateTemplate
Demo here