How to change the number of header columns dynamically?

How to change the number of header columns dynamically?

YorkYork Posts: 5Questions: 3Answers: 0

DataTables Examples assume the table header is constructed before dataTable() is called.
Can I construct the table header after dataTable() is called?

Besides, will options.columns support function callback in the further?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin
    Answer ✓

    Yes, DataTables can create columns for you on initialisation. There is an example here.

    You cannot create columns after DataTables has been initialised though (which normally what "dynamically" would refer to in this case).

    Besides, will options.columns support function callback in the further?

    There is no plan for that at the moment since the array is used immediately and therefore the function would just be immediately evaluated and never again. So you'd be as well just executing the function yourself.

    Allan

This discussion has been closed.