title: jqGrid: set a color conditional custom formatter based on row values
body: <p>I've seen other posts on this subject but my is slightlty different
  I have a jqGrid as shown below with the following name: </p>
  
  <pre><code> grid = $("#list");
  </code></pre>
  
  <p>Now, I have a column named total and I want to set a color for the numbers based on a value. I tried like this</p>
  
  <pre><code>grid.jqGrid({
  ...
  colModel:[
  ...
  {name:'total',index:'total',width:60,
      formatter:function(cellvalue, options, rowObject){
                if (cellvalue &gt; 300) {
                return "&lt;span style='background-color:orange'&gt;"+cellvalue+"&lt;/span&gt;";
                } else {
                return "&lt;span style='color:red'&gt;"+cellvalue+"&lt;/span&gt;";
                }
                },
  
                    align:'right'},
  ...
  </code></pre>
  
  <p>which seems to evaluate fine the if conditional but fail to display the cellvalue variable.</p>
  
  <p>How should I redisplay the total cell value with the proper markup inside the if brackets?</p>