Grid :: Row background color under 'Status' (dynamic info)

I have a grid with two columns.

  • The first is a ‘Status’ field (Posibble values: ‘Available’, ‘Some space’, ‘Full’)
  • The second is a ‘Container’s name’ field (Possible values: ‘Box 1’, ‘Box 2’,… ‘Box N’)

(I fill this grid using a PHP script with an XML output)

I’d like to show the ‘Available’ (row) containers in GREEN color, the ‘Some space’ containers in YELLOW color and the ‘Full’ containers with a RED background color.

Is it possible?

Thanks in advance.

Hello,

you can use templateCss that allows to set a function returning css name for a grid row.

For example:

dhx.ui({ view: "grid", ... type: { templateCss: function(obj,type){ var css = ""; if(obj.Status=="Available"){ css = "green"; } /*other css definitions here*/ return css; } } });

Where “green” css can be like so:

<style> .green{ color: green; } </style>