title: Datatable - Insert JSON data to the table
body: <p>I would like to insert JSON data into my table but I can make it to work, I keep getting error:</p>
  
  <blockquote>
    <p>datatables requested unknown parameter 0 for row 0</p>
  </blockquote>
  
  <pre><code>var myTable = $('#my_logs').DataTable({
          "paging": true,
          "lengthChange": true,
          "searching": true,
          "ordering": true,
          "info": true,
          "autoWidth": true
      }); 
  
  
  $( "#getResults" ).click(function() {
  
  $.ajax({
              url: "http://www.myurl.com/data",
              data: {
                  "from_date": from_date,
                  "to_date": to_date
              },              
              type: "POST",
              timeout: 30000,
              dataType: "json", // "xml", "json"
              success: function(logs) {
  
              $.each(logs, function( index, value ) {
                  myTable.clear().draw();
                  myTable.row.add({
                     "Date": "1234",
                     "User Name": "1234",
                     "Class": "1234",
                     "Function": "1234",
                     "Action": "1234",
                     "Description": "1234"
                  }).draw();
              }); 
  
              },
              error: function(jqXHR, textStatus, ex) {
                  alert(textStatus + "," + ex + "," + jqXHR.responseText);
              }
          });
  });
  </code></pre>
  
  <p>The data I am getting from the AJAX respond it's something like that:</p>
  
  <pre><code>[
  {
  "log_time":"2015-12-27 09:42:21",
  "user_name":"Me",
  "class_name":"login",
  "class_function":"authentication",
  "action_title":"User login",
  "action_description":"I am logged in"
  },
  {
  "log_time":"2015-12-27 09:42:21",
  "user_name":"me",
  "class_name":"dashboard",
  "class_function":"index",
  "action_title":"Admin dashboard",
  "action_description":"I am logged in"
  }
  ]
  </code></pre>