title: jQuery DataTable - Update values and render to HTML table
body: <p>I've got a jQuery DataTable object that holds log information - how many log messages of type Exception, information etc. an application has logged during a certain date range. I want to update those values as log messages are sent to the underlying DB. I'm currently using javascript to find a cell in HTML table based on an AppId and updating the innerHTML with the new log total. However, since not all applications may be visible e.g. if there are 15 but the table is only set to show 10 entries, I want to update the values in the DataTable object so the values are correct if/when the applications are included in the table.</p>
  
  <p>I've tried changing the values in the DataTable by doing something like this</p>
  
  <pre><code>var rows = table.rows().data();
  var arr = data.aaData;
  for (var i = 0; i &lt; arr.length; i++) {
          for (var r = 0; r &lt; rows.length; r++) {
              if (arr[i].ApplicationId == rows[r].AppId) {
                  if (arr[i].Debug != 0 || arr[i].Information != 0 || arr[i].Message != 0 || arr[i].Warning != 0 || arr[i].Exception != 0) {
                      //New Exception Count
                      if (arr[i].Exception !== 0) {
                          rows[r].Exception = arr[i].Exception;
                          flash(rows[r].AppId, 'Exception');
                      }
                      //New Warning Count
                      if (arr[i].Warning !== 0) {
                          rows[r].Warning = arr[i].Warning;
                          flash(rows[r].AppId, 'Warning');
                      }
                      //New Message Count
                      if (arr[i].Message !== 0) {
                          rows[r].Message = arr[i].Message;
                          flash(rows[r].AppId, 'Message');
                      }
                      //New Information Count
                      if (arr[i].Information !== 0) {
                          rows[r].Information = arr[i].Information;
                          flash(rows[r].AppId, 'Information');
                      }
                      //New Debug Count
                      if (arr[i].Debug !== 0) {
                          rows[r].Debug = arr[i].Debug;
                          flash(rows[r].AppId, 'Debug');
                      }
                  }
              }
          }
      }
      table.draw();
  </code></pre>
  
  <p>Where <code>data.aaData</code> is JSON format data returned from a controller method.
  Logging <code>rows</code> to the console I can see that values are updated in the DataTable object, but these new values aren't rendered to the HTML table during the <code>table.draw()</code> call.</p>
  
  <p>So does anyone have a standard way of making changes to values in a DataTable? I've tried using <code>table.cell(r, 5).data(someNewValue);</code> for example but this seems to produce some unreliable results.</p>