columnControl className property causes error in tables with hidden columns
columnControl className property causes error in tables with hidden columns

Link to test case:
https://live.datatables.net/pizzacat/3/edit
Debugger code (debug.datatables.net):
Error messages shown:
Uncaught TypeError: Cannot read properties of null (reading 'classList')
at datatables.min.js:69:744
at Array.forEach (<anonymous>)
at i (datatables.min.js:69:719)
at new S (datatables.min.js:69:30285)
at X.<anonymous> (datatables.min.js:69:32594)
at X.<anonymous> (datatables.min.js:30:76481)
at X.iterator (datatables.min.js:30:49847)
at X.<anonymous> (datatables.min.js:30:76382)
at X.every (datatables.min.js:30:50799)
at HTMLDocument.<anonymous> (datatables.min.js:69:32452)
Description of problem:
First I just want to say thank you for your swift responses and your dedication to maintenance and new features.
When adding the className property to columnControl configs on DataTables with hidden columns, the above error appears in the console and the table does not load/load properly. I am upgrading a complex table in one of our prod apps that uses two hidden columns at the end of the table in the Excel download.
I have tried adding the columnControl config to these hidden columns like I would with dt-control but it does not fix the issue:
{
data: 'cancelled_indicator',
visible: false,
columnControl: [
{
target: 0,
content: null
},
{
target: 1,
content: null
}
],
},
{
data: 'term_code',
visible: false,
columnControl: [
{
target: 0,
content: null
},
{
target: 1,
content: null
}
],
},
Am I doing something wrong? Thanks!
Answers
Nothing you are doing wrong there. It is a bug in ColumnControl. When the column is initialised as hidden, the cell isn't attached to the header, so it can't find the row - thus the error. Fix committed here which I'll release as part of 1.0.4 this afternoon.
Allan