Bugreport: Unable to destroy() DataTable

Bugreport: Unable to destroy() DataTable

TaloncorTaloncor Posts: 6Questions: 4Answers: 0
edited March 2015 in Free community support

I recently encountered a bug with DataTables while trying to destroy() my table. Upon calling .destroy() I was greeted with the following error:

TypeError: i[n] is undefined

...ad")[0]);for(n=0;n<e.length;n++)k=c[e[n]],i[n].style.width=null!==k.sWidthOrig&

JsFiddle Example

After some fiddling (scnr) I found that tables with invisible columns columns.visible cannot be destroyed.

Is there any way to circumvent this problem?

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    The number of HTML <th> columns have to match the DataTables' columns[] definition. In your case,

       <thead>
            <tr>
                <th>Status</th>
                <th>Date</th>
                <th>invisible-column</th>     <<<<< call it anything you like, it's invisible.
            </tr>
        </thead>
    
  • TaloncorTaloncor Posts: 6Questions: 4Answers: 0

    Thank you very much! :)

This discussion has been closed.