DataTables 1.10.11 with scrolling enabled duplicates footer leading to duplicate HTML element IDs

DataTables 1.10.11 with scrolling enabled duplicates footer leading to duplicate HTML element IDs

OxolotlOxolotl Posts: 1Questions: 1Answers: 0

Hi,

we recently upgraded DataTables from version 1.10.9 to 1.10.11 and now encounter a problem which we consider a bug: When creating a table with a footer which contains elements with IDs (e.g. input fields), the original footer is copied completely into the "middle" scrollable table which is located in a div with style class "dataTables_scrollBody".

jsFiddle for 1.10.11: https://jsfiddle.net/Oxolotl/rb4e8a2u/

Apart from having multiple elements with the same ID, the biggest problem is that the invisible copy is located before the original in the DOM tree, causing all jQuery selections to find the wrong element.

With the previous version, only the footer <td> elements where copied, without its contents. No duplicate elements thus no duplicate IDs.
jsFiddle for 1.10.9: https://jsfiddle.net/Oxolotl/73b00zhr/

The current workaround is to remove the copied footer completely from "dataTables_scrollBody" which makes me feel kind of uneasy and seems to cause problems with the automatic width calculation.

Answers

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    Thanks for posting this. I'll take a look into it and get back to you.

    Regards,
    Allan

  • burnpanckburnpanck Posts: 1Questions: 0Answers: 0

    I have a similar use-case where the duplicated elements break the site: Form elements in the footer when using the "required" attribute prevent the form from submitting because it's copy has not been filled.

This discussion has been closed.