Datatables bug with Jquery 3.5.1

Datatables bug with Jquery 3.5.1

VinceCapodannoVinceCapodanno Posts: 1Questions: 1Answers: 0

So with the upgrade to jquery 3.5, jquery stopped supporting self closing tags (https://jquery.com/upgrade-guide/3.5/).

Within Datatables source (using version 1.10.21), in the "__details_add" function we find the line "var created = $('<tr><td/></tr>').addClass( k );"

I am seeing "Uncaught TyperError: Cannot set property 'colSpan' of undefined". This is because when "$('<tr><td/></tr>')" is ran, the <td> element never actually gets created since its a self closing tag. Manually I have changed it to "$('<tr><td></td></tr>')" and then things work as expected.

This is triggered by us calling fnOpen and passing a row (<tr> element), a string of html, and a string that a classname.

Answers

  • allanallan Posts: 61,453Questions: 1Answers: 10,055 Site admin

    Thank you! That one slipped by me. I've committed the fix and it will be in the nightly shortly, and DataTables 1.10.22 when we ship that.

    Allan

This discussion has been closed.