My table has blank value for some column, it gives Cannot set property '_DT_CellIndex' of undefined.

My table has blank value for some column, it gives Cannot set property '_DT_CellIndex' of undefined.

ali_mohdali_mohd Posts: 3Questions: 1Answers: 0

I have table with dynamic column i.e. table has different column for different cases. It has blank value for some column, therefore it gives error 'Cannot set property '_DT_CellIndex' of undefined' in console. How to fix this error...???

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,307Questions: 26Answers: 4,769

    Many times this error is generated when colspan or rowspan appear in the tbody of the table. Is the case?

    If not then please provide a link to your code showing the issue.

    Kevin

  • ali_mohdali_mohd Posts: 3Questions: 1Answers: 0

    Please provide your email, so that I can give you link and user access details.

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin

    Could you just paste your HTML and Javascript into http://live.datatables.net please?

    Thanks,
    Allan

  • kthorngrenkthorngren Posts: 20,307Questions: 26Answers: 4,769
    Answer ✓

    It looks like you have 21 columns defined in thead but none of your rows has 21 columns. The first row has 20 and the next two have 18 each. Datatables needs a cell for each column. I added blank cells to the end of each row and eliminated the error.

    http://live.datatables.net/jewotamu/2/edit

    Kevin

  • MadhuraMadhura Posts: 1Questions: 0Answers: 0

    I am facing same issue.I have blank value in td element for no record (count of th and td matches) still does not work, have to replace with null to make it work temporarily.
    Also some fields are date and when those columns are pulled in it fails..Please advice.

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    hi @Madhura ,

    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

This discussion has been closed.