title: Refresh Datatable Error
body: <p>After making a new record, I want my table to be updated, for which I am using</p>
  
  <pre><code>$('#example_id_table').DataTable().ajax.reload();
  </code></pre>
  
  <p>However this throws me the following error:</p>
  
  <pre><code>DataTables warning: table id=tblCategory - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
  </code></pre>
  
  <p>Edit: Error in Console to Browser</p>
  
  <pre><code>Uncaught TypeError: Cannot set property 'data' of null
  at sa (datatables.min.js:48)
  at Sb (datatables.min.js:119)
  at s.&lt;anonymous&gt; (datatables.min.js:120)
  at s.iterator (datatables.min.js:111)
  at s.&lt;anonymous&gt; (datatables.min.js:120)
  at Object.reload (datatables.min.js:114)
  at Object.success (pagos_tipos.js:72)
  at i (jquery-3.2.1.min.js:2)
  at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js:2)
  at A (jquery-3.2.1.min.js:4)
  </code></pre>
  
  <p>I am trying to refresh the table in the following way</p>
  
  <pre><code>$("#btn_insert").click(function(){
  
      var id = $("#id").val();
      var description = $("#description").val();
  
      $.ajax({
  
          url: baseurl+"C_Category/Insert/",
          type: 'post',
          data: { "id": id, "description": description },
  
          success: function(response){
  
             $("#modal_new").modal('hide');
  
             $("#modal_alert").modal('show');
  
             $('#tblCategory').DataTable().ajax.reload();
  
          }
      });
  });
  </code></pre>
  
  <p>I'm showing the data in this way. <code>getCategory</code> uses <code>echo json_encode</code> to fetch the Model data that contains the SQL query</p>
  
  <pre><code>$.post(baseurl+"C_Category/getCategory",
  function(data){
  
      var obj = JSON.parse(data);
      $.each(obj, function(i, item){
          $("#tblCategory").append(
              '&lt;tr&gt;'+
              '&lt;td &gt;'+item.id+'&lt;/td&gt;'+
              '&lt;td&gt;'+item.description+'&lt;/td&gt;'+
              '&lt;td&gt;&lt;a href="#" title="Update" data-toggle="modal" data-target="#modalUpdate" onClick="selPagos(\''+item.id+'\',\''+item.description+'\');"&gt;&lt;i style="color:#555;"  class="glyphicon glyphicon-edit" &gt;&lt;/i&gt;Update&lt;/a&gt;&lt;/td&gt;'+
              '&lt;/tr&gt;'
          );
      });
  $("#tblCategory").DataTable({
  
          'paging': true,
          'info': true,
          'filter': true
  
      });
  });
  </code></pre>