generating dynamic columns
generating dynamic columns
rohanyerolkar
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?
This discussion has been closed.
Answers
You can have DataTables generate columns for you using the
columns
option when you create the DataTable. usecolumns.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