Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined - Page 2

Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined

2»

Answers

  • allanallan Posts: 55,097Questions: 1Answers: 8,649 Site admin

    In that case, I'd need a test case showing the issue, as I noted above, to be able to provide any help.

    Allan

  • gil_villarrealgil_villarreal Posts: 1Questions: 0Answers: 0

    Please disregard my last post submission to this thread, as I found the problem was a simple header/column mismatch in the subsequent table. Thank you!

  • Syed RSyed R Posts: 2Questions: 0Answers: 0

    can some one please help me here, i am trying to add filter on table (see attached), but its giving me Cannot set property '_DT_CellIndex' error. If someone can correct it i would appreciate it

  • kthorngrenkthorngren Posts: 14,616Questions: 25Answers: 3,469

    The problem is that Datatables doesn't support rowspan or colspan within the tbody of a table.

    Kevin

  • Syed RSyed R Posts: 2Questions: 0Answers: 0

    Thanks Kevin

    Is there a work around? please share

  • kthorngrenkthorngren Posts: 14,616Questions: 25Answers: 3,469

    Is there a work around?

    You could use something like Row Details to display the specific interface data when the row is expanded.

    Or you could use columns.render to render the data into the desired format. Meaning you could render each interface onto a new line in the row for the server. The server would have one row (not rowspan) and each interface in for that server would be in that row but on a new line (<br /> maybe).

    Kevin

  • allanallan Posts: 55,097Questions: 1Answers: 8,649 Site admin

    Yup - fundamentally DataTables does not support colspan or rowspan in the tbody, exactly as Kevin says. There really isn't a good workaround for that I'm afraid. It simply isn't something that is supported. That might change in future, but not in the short term.

    Allan

  • brandonccbrandoncc Posts: 1Questions: 0Answers: 0

    Is there a recommended solution when I have to have colspan in my table? Does anybody know of another solution that is similar and will work?

  • sepulgue23sepulgue23 Posts: 1Questions: 0Answers: 0

    El problema '_DT_CellIndex' of undefined". lo solucione artesanalmente. Si la tabla de datos no tiene datos; pregunto y creo una fila en la tabla vacia. Ejemplo:
    $lista_roles es resultado de una consulta a mi BD
    ......
    $fila = ' ';
    if (count($lista_roles) == 0) {
    $fila .= '<tr><td>NO EXISTEN DATOS</td>;
    $fila .= '<td></td>'; $fila .= '<td></td>'; $fila .= '<td></td>';
    $fila .= '<td></td>'; $fila .= '<td></td>'; $fila .= '<td></td></tr>';
    }
    else {
    foreach ($lista_roles as $roles) {
    ......

  • phi1ippphi1ipp Posts: 6Questions: 1Answers: 0

    One more use case with the same error is when your td contains <div> with icons...

    <td>
       <div class="btn-group-sm">
          <a asp-page="/Broker/Members" asp-route-id="@broker.externalId">
             <i class="fas fa-eye"></i> 
          </a>
          <button type="button" class="btn btn-primary"> 
             <i class="fas fa-envelope"></i> 
          </button> 
       </div>
    </td>
    
  • allanallan Posts: 55,097Questions: 1Answers: 8,649 Site admin

    @phi1ipp - That shouldn't make any difference. Can you link to a page showing that problem please?

    Allan

  • phi1ippphi1ipp Posts: 6Questions: 1Answers: 0

    @allan,

    Oops, you got me! After your words I went online prepping a js-fiddle for you and reduced my table row count and figured it worked as expected. The problem was I had a rogue <tr> at the end of the table.

    Thank you for your hard work, the component is just a masterpiece!

  • colincolin Posts: 13,279Questions: 0Answers: 2,268

    Hi @cintadewiamelia ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • BSDGuruBSDGuru Posts: 5Questions: 2Answers: 0

    Might be good to say you don't support colspan in the intro to the product to save ppl a half day's work

  • allanallan Posts: 55,097Questions: 1Answers: 8,649 Site admin

    Fair point! It does say it in the FAQs, but I'll add it into the HTML requirements section of the installation documentation as well.

    Allan

This discussion has been closed.