Error when re-initializing a table, non-visible column breaking

Error when re-initializing a table, non-visible column breaking

rvgrahamrvgraham Posts: 28Questions: 5Answers: 0
edited June 2013 in Bug reports
The actual error shown is "Unable to get property 'style' of undefined or null reference" when it hits the 'for' loop at line 3645 of the non-min version of datatables.js.

I have 'bDestroy' true, but when it hits this function in the datatables js file while filling the table again in the same session, the bVisible property of the one and only hidden column has been lost, oSettings now says bVisible = true, where it showed the proper 'false' value on initial load. Therefore, [code]nThs[i-iCorrector][/code] is undefined, because the visible column count is now wrong.

I have tried [code]oTable.fnSetColumnVis(11, false)[/code] if it's not the initial display, but to no avail.

I have carefully analyzed my code for trailing commas etc. but have not yet found a syntactic problem.

My HTML table has a two row header (for per-column filtering), with an equal number of th elements in each row and the same number of td elements in the body.

Bob Graham

Replies

  • rvgrahamrvgraham Posts: 28Questions: 5Answers: 0
    Okay, answered my own question... (Always happens after I agonize about posting and finally do.)

    Seems that non-visible columns should still have th's and td's in the html, which are then hidden by dataTables. I've ignored this logic many times before without issue, but in this case adding the never-to-be-seen elements in the HTML stopped the problem.
This discussion has been closed.