generating dynamic columns

generating dynamic columns

rohanyerolkarrohanyerolkar Posts: 10Questions: 5Answers: 1

Hi,

I have a requirement where i have to select some columns in a listbox and based on column selection i have to get data from DB and add data to data tables. Column numbers and headers may vary based on listbox selection. Does anyone have any idea about this?

How do i bind this to datatables and create datatable?

Answers

  • allanallan Posts: 63,461Questions: 1Answers: 10,466 Site admin

    You can have DataTables generate columns for you using the columns option when you create the DataTable. use columns.title to set the title for the header text, and make sure the HTML table is completely empty when you initialise it.

    DataTables cannot at this time add and remove columns dynamically after initialisation.

    Allan

This discussion has been closed.