Dynamically customize the header
Dynamically customize the header
WilWork
Posts: 6Questions: 2Answers: 0
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Hi,
I would like to customize the header of the columns dynamically (js and not in html) by adding for example a menu, a button like the example below. Is this possible?
Thanks
Answers
The only thing special about the Datatables header is that it adds click events for sorting. The easiest way to do this is to create a second header with your elements and use
orderCellsTop
to control which header Datatables uses for sorting.Kevin
Ok thank you.
I will see to modify the headers of the columns once created by reinjecting html with js.
See this example. Its updating the footer but can do something similar with the header.
Kevin
Great ! thank you !