Child Detail Rows examples and ColumnControl

Child Detail Rows examples and ColumnControl

kthorngrenkthorngren Posts: 22,162Questions: 26Answers: 5,102
edited July 15 in Web-site

The two Child Rows examples:
https://datatables.net/examples/api/row_details.html
https://datatables.net/examples/api/row_details_stateSave.html

Use columns.className to assign the dt-control classname to the column's cells, including the header. When using ColumnControl to create new headers the selector used in the examples will cause errors like this:

Uncaught TypeError: Cannot read properties of undefined (reading 'name')

when clicking in the header td's created by ColumnControl. Here is a test case:
https://live.datatables.net/dufaheqa/1/edit

Updating the examples with a selector like table.on('click', 'tbody td.dt-control', function (e) { will allow the developers to directly copy the examples and use ColumnControl`.

Kevin

Replies

  • allanallan Posts: 64,756Questions: 1Answers: 10,716 Site admin

    Hi Kevin,

    Thanks so much for finding this and proposing the fix. Completely agree and have committed the fix here which will be updated on the site soon.

    Allan

Sign In or Register to comment.