title: Handsontable - customizing renderers depending on cell values
body: <p>One of the columns in my handsontable has the following requirement:</p>
  
  <p>Set cell color differently based on a value that is not part of the table.  Here is the full code - </p>
  
  <p><a href="http://jsfiddle.net/3b1nc46b/" rel="nofollow">http://jsfiddle.net/3b1nc46b/</a></p>
  
  <pre><code>var objectData = [
    {id: 1, name: "Ted Right", address: "NY", value:{old_value:"10", new_value:"15"}},
    {id: 2, name: "Frank Honest", address: "CA", value:{old_value:"12", new_value:"12"}},
    {id: 3, name: "Joan Well", address: "TX", value:{old_value:"20", new_value:"28"}}
  </code></pre>
  
  <p>];</p>
  
  <pre><code>var valueRenderer = function (instance, td, row, col, prop, value, cellProperties) {
  var background_color = '';
  if (value.old_value == value.new_value) {
      background_color = 'white';
  } else {
      background_color = 'yellow';
  }
  value = value.new_value;
  Handsontable.renderers.NumericRenderer.apply(this, arguments);
  $(td).css({
    background: background_color
  });
  </code></pre>
  
  <p>};    </p>
  
  <p>In this the "Value" column needs to be colored yellow, if old_value is not equal to new_value - if not, the background should be white.  To start with I put the new_value and old_value in a nested "value" item, in the data source.  This works, but it creates other problems:</p>
  
  <ol>
  <li>When you click on a cell to edit, it shows "[object Object]" instead of the value - which makes sense, as I had passed "value" in the columns list, instead of "value.new_value"</li>
  <li>The background color is not retained</li>
  </ol>
  
  <p>One way to fix this would be to have a hidden column that contains the old_value, and use it to compare and set the renderer.  But if the table has 10 columns or more, and if every column needs to be colored based on the condition described above, it would quickly become too big (also would need special handling during the save function)</p>
  
  <p>What is the best way to do this?</p>