Dynamic creation of footer through columns definition.
Dynamic creation of footer through columns definition.
adrianw
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
You could clone the header to the footer in
initComplete
. However things likecolumn().footer()
likely won't work because Datatables expects the footer to exist. If you are usingfooterCallback
you can do the cloning there but you will need to first check if it exists since this callback can run multiple times.Kevin