Add table columns dynamically
Add table columns dynamically
soulbriski
Posts: 21Questions: 7Answers: 0
Is it possible to add further columns to an already initilized table?
Something like table.columns.add({data:newData, title:newTitle})
Answers
No, there is not a way to dynamically add columns to an initialized table. To change most Datatables options you will need to
destroy()
the Datatable then reinitialize with the new options.Depending on your requirements it might be possible to hide the column with
columns.visible
then display it later with the new data that you add usingcell().data()
orrow().data()
.Kevin