php - jQuery DataTables: Uncaught TypeError: Cannot read property 'mData' of undefined -


why i'm getting error

uncaught typeerror: cannot read property 'mdata' of undefined

i respect datatables requirements (and read topics error , respect every answer , solution). please me.

here php code:

<table class="table table-striped table-bordered table-hover" id="sample_1">         <thead>             <tr>                 <th class="table-checkbox">                     <input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>                 </th>                 <th>                      utilizator                 </th>                 <th>                      nume complet                 </th>                 <th>                      clasa                 </th>                 <th>                      functia                 </th>                 <th>                      e-mail                 </th>                 <th>                      ultima logare                 </th>             </tr>         </thead>         <tbody>             <?                foreach($data["users"] $student)                {             ?>             <tr class="odd gradex">                 <td>                     <input type="checkbox" class="checkboxes" value="1"/>                 </td>                 <td>                      <? echo $student["username"]; ?>                 </td>                 <td>                      <? echo " ".$student["last_name"]." ".$student["first_name"].""; ?>                 </td>                 <td>                      <? echo getclass($student["class"]); ?>                 </td>                 <td>                      <?                      $functie = 0;                      if($student["role"] == 1)                      {                          $functie = 1;                          echo "administrator site";                      }                      if($student["fctsc"])                      {                          $functie = 1;                          echo "director";                      }                      if($student["diriginte"])                      {                          $functie = 1;                          echo "diriginte";                      }                      if($student["profesor"])                      {                          $functie = 1;                          echo "profesor";                      }                      if($functie == 0)                          echo "elev";                      ?>                 </td>                 <td>                     <a href="mailto:<? echo $student["email"]; ?>">                         <? echo $student["email"]; ?>                     </a>                 </td>                 <td class="center">                      <? echo $student["lastlogin"]; ?>                 </td>             </tr>             <?                }             ?>         </tbody>     </table> 

check weather or not php echo's outputting not 'null' on rows datatables treat cell null content non existant , can cause error.
try avoiding direct php output html table.


Comments