not working because of TypeError: c is undefined

not working because of TypeError: c is undefined

bwhebwhe Posts: 2Questions: 1Answers: 0
edited July 2020 in Free community support

<table id="wp" class="table table-bordered table-sm"><thead><tr><th></th><th colspan='2' class='dayleftborder dayrightborder'>13-07 maandag </th><th colspan='2' class='dayleftborder dayrightborder'>14-07 dinsdag </th><th colspan='2' class='dayleftborder dayrightborder'>15-07 woensdag </th><th colspan='2' class='dayleftborder dayrightborder'>16-07 donderdag </th><th colspan='2' class='dayleftborder dayrightborder'>17-07 vrijdag </th><th colspan='2' class='dayleftborder dayrightborder'>18-07 zaterdag </th><th colspan='2' class='dayleftborder dayrightborder'>19-07 zondag </th></tr></thead><tbody><tr><td style='background-color:;'>task<br></td><td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder' colspan='2'><div class='bg-info' style='color:#fff;'>cdcvdvcd</div></td><td class=' dayleftborder dayrightborder' colspan='2'><div><n><span data-idp='88' class='person p_88'>john</span> (NUC)</n></div></td><td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder' colspan='2'></td><td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder' colspan='2'></td><td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder' colspan='2'></td><td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder weekenddag' colspan='2'></td><td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder weekenddag' colspan='2'></td></tr></tbody><tfoot><tr><th></th><th colspan='2' class='dayleftborder dayrightborder'>13-07 maandag </th><th colspan='2' class='dayleftborder dayrightborder'>14-07 dinsdag </th><th colspan='2' class='dayleftborder dayrightborder'>15-07 woensdag </th><th colspan='2' class='dayleftborder dayrightborder'>16-07 donderdag </th><th colspan='2' class='dayleftborder dayrightborder'>17-07 vrijdag </th><th colspan='2' class='dayleftborder dayrightborder'>18-07 zaterdag </th><th colspan='2' class='dayleftborder dayrightborder'>19-07 zondag </th></tr></tfoot></table>

why TypeError: c is undefined in the console. It passes every inline table validator
I checked it a 100 times.. Maybe someone can help me? Thanks in advance!

Edited by Kevin:  Syntax highlighting. Details on how to highlight code using markdown can be found in this guide

Answers

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    why TypeError: c is undefined in the console.

    At a minimum please post your Datatables and Editor code. Also post the full tracebcak and let use know which line in your script the traceback points to. Better is a link to your page so we can take a look or a test case replicating the issue.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    A search of the forum for the error TypeError: c results in this thread:
    https://datatables.net/forums/discussion/comment/155485/#Comment_155485

    Kevin

  • bwhebwhe Posts: 2Questions: 1Answers: 0

    the "table-code" is one line only. (The link to this page isn't public). I've searched the forum alredy and in the other threads there was somsthing wrong with the number of columns or wrong closing tags. But the code above is valid in my opninon...(?).

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    You have this for the header:

    <table id="wp" class="table table-bordered table-sm">
    <thead>
    <tr>
    <th></th>
    <th colspan='2' class='dayleftborder dayrightborder'>13-07 maandag </th>
    <th colspan='2' class='dayleftborder dayrightborder'>14-07 dinsdag </th>
    <th colspan='2' class='dayleftborder dayrightborder'>15-07 woensdag </th>
    <th colspan='2' class='dayleftborder dayrightborder'>16-07 donderdag </th>
    <th colspan='2' class='dayleftborder dayrightborder'>17-07 vrijdag </th>
    <th colspan='2' class='dayleftborder dayrightborder'>18-07 zaterdag </th>
    <th colspan='2' class='dayleftborder dayrightborder'>19-07 zondag </th>
    </tr>
    </thead>
    

    Take a look at the docs for the Complex Header example. It states this:

    Each column must have one TH cell which is unique to it for the listeners to be added.

    While you can use colspan in the header you must have one header row that has a th for each column.

    Also you have colspan in the tbody which isn't supported by Datatables. See the HTML Requirements of the installation doc.

    <tr>
    <td style='background-color:;'>task<br></td>
    <td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder' colspan='2'><div class='bg-info' style='color:#fff;'>cdcvdvcd</div></td>
    <td class=' dayleftborder dayrightborder' colspan='2'><div><n><span data-idp='88' class='person p_88'>john</span> (NUC)</n></div></td>
    <td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder' colspan='2'></td>
    <td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder' colspan='2'></td>
    <td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder' colspan='2'></td>
    <td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder weekenddag' colspan='2'></td>
    <td class=' nietsgeplandofnietzichtbaar dayleftborder dayrightborder weekenddag' colspan='2'></td>
    </tr>
    

    Kevin

This discussion has been closed.