title: Angular/Datables server-side processing
body: <p>I am trying to implement DataTables server-side processing/pagination for a table in angularjs. I have used the DataTables example but my table does not show. I am pretty sure I am missing one slight thing but can't figure it out....tried many things....</p>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;div class="table-responsive"&gt;
  &lt;table id="consolidatedPageTable" class="table table-condensed table-striped table-bordered" &gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th &gt;Source&lt;/th&gt;
              &lt;th &gt;Mailing Date&lt;/th&gt;
              &lt;th &gt;Status&lt;/th&gt;
              &lt;th &gt;CPI&lt;/th&gt;
              &lt;th &gt;User ID&lt;/th&gt;
              &lt;th &gt;Program&lt;/th&gt;
              &lt;th &gt;Customer Number&lt;/th&gt;
              &lt;th &gt;Customer Name&lt;/th&gt;
              &lt;th &gt;DL Date&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p></p>
  
  <p>My controller:</p>
  
  <pre><code>app.controller('ConsolidatedController', function($scope,$rootScope,$http,$filter,$location,$routeParams) {
  
      createTable();
  
      $location.path('consolidated');
  
  });
  
  function createTable(){
  $(function(){
      var table = $('#consolidatedPageTable').dataTable({
          "destroy": true,    
          "processing": true,
          "serverSide": true,
          "ajax": "scripts/consolidationTable.php",       
          "columnDefs": [
          {
              "targets": [9],
              "visible": false,
              "searchable": true
          }
      ]
      });
  })
  }
  </code></pre>
  
  <p>My php scipt (I replaced server specific information with XXX)</p>
  
  <pre><code>&lt;?php
  error_reporting(0);
  $table = "consolidated";
  $primaryKey = "customerNumber";
  $columns = array();
  $columns[] = array('db' =&gt; 'source' , 'dt' =&gt; 0);
  $columns[] = array("db"=&gt;"mailingDate","dt"=&gt;1);
  $columns[] = array("db"=&gt;"status","dt"=&gt;2);
  $columns[] = array("db"=&gt;"cpi","dt"=&gt;3);
  $columns[] = array("db"=&gt;"userId","dt"=&gt;4);
  $columns[] = array("db"=&gt;"shorttext","dt"=&gt;5);
  $columns[] = array("db"=&gt;"customerNumber","dt"=&gt;6);
  $columns[] = array("db"=&gt;"customerName","dt"=&gt;7);
  $columns[] = array("db"=&gt;"dlDate","dt"=&gt;8);
  $sql_details = array("user" =&gt; "XXX","pass" =&gt; "XXX","db" =&gt; "XXX","host" =&gt; "XXX");
  require("ssp.class.php");
  echo json_encode(SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ));
  ?&gt;
  </code></pre>
  
  <p>I can run the php script by itself and it displays the correct data in the format shown in the dataTables example. In my application though, on the screen all I get is the header line and it does not appear to be in a dataTables looking format. </p>
  
  <p>Can anyone see what could be causing no data to show? </p>