How to use column grouping from data source other than already rendered DOM

How to use column grouping from data source other than already rendered DOM

suricactussuricactus Posts: 3Questions: 1Answers: 0

I'm looking this example: https://datatables.net/examples/advanced_init/complex_header.html

I wonder how to achieve the same result with Javascript/Ajax source of data?

Answers

  • allanallan Posts: 62,327Questions: 1Answers: 10,227 Site admin

    Details on how to Ajax source data with your DataTable are available here. Basically you need to use ajax.

    Allan

  • suricactussuricactus Posts: 3Questions: 1Answers: 0

    I mean how to achieve complex header example, where I have colspan on first row and subheaders on next header row. In the example is clear how to achieve this using DOM as API, my question is how to make complex headers with columns option?

  • allanallan Posts: 62,327Questions: 1Answers: 10,227 Site admin

    There is no option to create a complex header using DataTables' initialisation options. There are a number of other threads on this topic if you use the search bar at the top of the page - for example.

    You would need to use jQuery / DOM methods to create the complex header before the DataTable is created I'm afraid.

    Allan

  • suricactussuricactus Posts: 3Questions: 1Answers: 0

    Thank you, Allan.

    If there is any plan to support it, I might help with the implementation.

  • allanallan Posts: 62,327Questions: 1Answers: 10,227 Site admin

    Currently no because I'm not sure what a good API for it would be. Any suggestions welcome.

    Allan

This discussion has been closed.