An Approach To Fully Compatible Complex Headers

An Approach To Fully Compatible Complex Headers

chboccachbocca Posts: 86Questions: 13Answers: 1

Currently, complex headers are incompatible with colReorder.

I find that the approach illustrated in the following demo provides full compatibility with colReorder and DataTables generally.

It has its limitations, but when a table has lots of columns, I find adding "labels" to related groups of columns very helpful in lieu of true complex headers.

Perhaps others will find it helpful too.

Or provide feedback, especially if the approach is flawed.

Thanks, c

Replies

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    edited February 2018

    Thats a great idea. I may be able to use this with one of my current projects. Haven't decided if I will enable colReorder but do like the "labels" concept. If I do use it I will provide feedback with my results.

    Thanks for sharing.

    Kevin

  • chboccachbocca Posts: 86Questions: 13Answers: 1

    You're welcome.

    Updated demo after some streamlining.

    Also, think I can make the "Labels" button a custom datatable button instead of using on- click jQuery method.

    Will post any further updates.

    c

  • chboccachbocca Posts: 86Questions: 13Answers: 1

    OK, updated demo to reflect customized "Labels" button.

    Using 'extend: ColumnToggle' for buttons wherever possible to eliminate manual toggle tracking.

    Again, until true complex header compatibility is brought to DataTables, I'm hoping this "Labels" approach provides a viable work-around.

    c

  • chboccachbocca Posts: 86Questions: 13Answers: 1

    Updated demo address. c

  • jensontpjensontp Posts: 1Questions: 0Answers: 0

    The demo seems to be missing. Could you please create a fiddle with the demo code?

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    When I click the demo link it pulls up the demo.

    Kevin

This discussion has been closed.