My kendo grid has special column with values: "Unpaid", "Paid". From backend arrives 0 - means "Unpaid", 1 - means "Paid".
My config for this column:
{
columnMenu: true
encoded: true
field: "Invoice__state"
filterable: {cell: {…}}
resizable: true
sortable: true
title: "State"
type: "string"
values: Array(2)
0: {value: 1, text: "Paid"}
1: {value: 0, text: "Unpaid"}
}
Everysing fine (pic 1).
Now I need to make some markup for column - red for Unpaid, green for Paid. I want to use template for column. I just add simple template
template: "<span class="label label-danger">#: Invoice__state #</span>"
But now I see 0 or 1 instaed Unpaid or Paid (pic 2).
How I can modify template to show label instead values ?
You can do with help of attribute by condition.
Here code for your reference.
CSS Block :
Javascript Block: