I am working on the DataTable showing the weekly data. The headers should be added dynamically. In my case, the table header is loading properly for the first time. I am using the DateTime picker, on changing the date the DataTable should re-initialize, and the column header title should change accordingly.
The column is not binding from the second time.
Can i get any suggestion on this?
Here is my part of code
table: {
searchDisabled: true,
url: URLS.patientDetails.reminders.getWeeklyData,
selector: adherenceReportWeekly,
columns: [
{
title: SetTableTitle(0),
data: function (row) {
return GetRowDatas(row, 0);
},
width:14
},
{
title: SetTableTitle(1),
data: function (row) {
return GetRowDatas(row, 1);
},
width:14
},
{
title: SetTableTitle(2),
data: function (row) {
return GetRowDatas(row, 2);
},
width:14
},
{
title: SetTableTitle(3),
data: function (row) {
return GetRowDatas(row, 3);
},
width:14
},
{
title: SetTableTitle(4),
data: function (row) {
return GetRowDatas(row, 4);
},
width:14
},
{
title: SetTableTitle(5),
data: function (row) {
return GetRowDatas(row, 5);
},
width:14
},
{
title: SetTableTitle(6),
data: function (row) {
return GetRowDatas(row, 6);
},
width:14
}
],
ordering: false,
pageLength: 25,
dontAddTableClass: true
},