Dynamic creation of footer through columns definition.

Dynamic creation of footer through columns definition.

adrianwadrianw Posts: 1Questions: 0Answers: 0

I have a table where the table headers are created using the column definitions columns.title rather than the DOM

https://datatables.net/reference/option/columns.title

Is there way to define the footer through columns eg. something like columns.footer, or an option to automatically copy header to footer.

I've looked through the docs and can't see anything obvious

Thanks in advance,
Adrian

Replies

  • kthorngrenkthorngren Posts: 21,182Questions: 26Answers: 4,925

    You could clone the header to the footer in initComplete. However things like column().footer() likely won't work because Datatables expects the footer to exist. If you are using footerCallback you can do the cloning there but you will need to first check if it exists since this callback can run multiple times.

    Kevin

Sign In or Register to comment.