title: jQuery Datatables large data set Uncaught TypeError: Cannot read property 'mData' of undefined
body: <p>So I get a console error on a large set of rows that I'm iterating from a database with php. I am initializing this with the metronic theme. As you can see I have my thead and tbody.</p>
  
  <p>I suspect the issue could pertain to the size of the output and maybe needing to use another method, any guidance appreciated</p>
  
  <pre><code>&lt;table id="sample_1" class="table table-striped table-bordered table-hover"&gt;
      &lt;thead&gt;
            &lt;tr&gt;
              &lt;th class="table-checkbox"&gt;
                &lt;input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/&gt;
              &lt;/th&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Source&lt;/th&gt;
              &lt;th&gt;Email&lt;/th&gt;
              &lt;th&gt;Customer&lt;/th&gt;
              &lt;th&gt;Created&lt;/th&gt;
              &lt;th&gt;Login&lt;/th&gt;
              &lt;th&gt;Active&lt;/th&gt;
              &lt;th&gt;Role&lt;/th&gt;
              &lt;th&gt;Incentive&lt;/th&gt;
              &lt;th&gt;View&lt;/th&gt;
              &lt;th&gt;Switch&lt;/th&gt;
              &lt;th&gt;Email&lt;/th&gt;
            &lt;/tr&gt;        
          &lt;/thead&gt;
        &lt;tbody&gt;
  
        &lt;?php
          $users=user::get_all($filter);
          if($users){
            foreach($users as $row){
              $customer=user::get_cutomer_name_by_source_id($row['source_id']);
              ?&gt;
              &lt;tr class='odd gradeX'&gt;
                &lt;td&gt;&lt;input type='checkbox' class='checkboxes' value='1'/&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php echo $row['first_name']." ".$row['last_name']; ?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php echo $row['source_id']; ?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php echo $row['email']; ?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php echo $customer; ?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php echo date("m/d/Y", strtotime($row["created"])); ?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php if($row['login']!=NULL){echo date("m/d/Y",$row['login']);} ?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php if($row['active']==1){echo "Yes";}else{echo "No";} ?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php echo user::get_role_name($row['rid']); ?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php 
                  if($row['cash_incentive']==1){echo "Cash";}else{echo "Regular";} ?&gt;
                  &lt;/td&gt;
                &lt;td&gt;&lt;a href='user-edit?uid="&lt;?php echo $row['uid']; ?&gt;"'&gt;View &lt;/a&gt;&lt;/td&gt;
                &lt;td&gt;&lt;a href='switch?email="&lt;?php echo $row['email']; ?&gt;"'&gt; Switch&lt;/a&gt;&lt;/td&gt;
                &lt;td&gt;&lt;input type='checkbox' name='email-list[]' value='&lt;?php echo $row['email']; ?&gt;'&gt;&lt;/td&gt;
              &lt;/tr&gt;   
            &lt;?php }
          }
        ?&gt;
  
  &lt;/tbody&gt;
  </code></pre>
  
  <p></p>
  
  <p>And here is the metronic init for the datatable:</p>
  
  <pre><code>table.dataTable({
  
          // Internationalisation. For more info refer to http://datatables.net/manual/i18n
          "language": {
              "aria": {
                  "sortAscending": ": activate to sort column ascending",
                  "sortDescending": ": activate to sort column descending"
              },
              "emptyTable": "No data available in table",
              "info": "Showing1 _START_ to _END_ of _TOTAL_ entries1",
              "infoEmpty": "No entries found",
              "infoFiltered": "(filtered1 from _MAX_ total entries)",
              "lengthMenu": "Show _MENU_ entries",
              "search": "Search:",
              "zeroRecords": "No matching records found"
          },
  
          // Or you can use remote translation file
          //"language": {
          //   url: '//cdn.datatables.net/plug-ins/3cfcc339e89/i18n/Portuguese.json'
          //},
  
          // Uncomment below line("dom" parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout
          // setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js). 
          // So when dropdowns used the scrollable div should be removed. 
          //"dom": "&lt;'row'&lt;'col-md-6 col-sm-12'l&gt;&lt;'col-md-6 col-sm-12'f&gt;r&gt;t&lt;'row'&lt;'col-md-5 col-sm-12'i&gt;&lt;'col-md-7 col-sm-12'p&gt;&gt;",
  
          "bStateSave": true, // save datatable state(pagination, sort, etc) in cookie.
  
          "columns": [{
              "orderable": false
          }, {
              "orderable": true
          }, {
              "orderable": false
          }, {
              "orderable": false
          }, {
              "orderable": true
          }, {
              "orderable": true
          }, {
              "orderable": true
          }, {
              "orderable": true
          }, {
              "orderable": true
          }, {
              "orderable": true
          }, {
              "orderable": true
          }, {
              "orderable": false
          }],
          "lengthMenu": [
              [5, 15, 20, -1],
              [5, 15, 20, "All"] // change per page values here
          ],
          // set the initial value
          "pageLength": 5,            
          "pagingType": "bootstrap_full_number",
          "language": {
              "search": "My search: ",
              "lengthMenu": "  _MENU_ records",
              "paginate": {
                  "previous":"Prev",
                  "next": "Next",
                  "last": "Last",
                  "first": "First"
              }
          },
          "columnDefs": [{  // set default column settings
              'orderable': false,
              'targets': [0]
          }, {
              "searchable": false,
              "targets": [0]
          }],
          "order": [
              [1, "asc"]
          ] // set first column as a default sort by asc
      });
  </code></pre>