Angualrjs Datatable loaded more than one issue
Angualrjs Datatable loaded more than one issue
I having a datatable data from ajax and created the columns dynamically. However, i found out the table always re-initialise lead to some objects loss from the settings.
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('ajax', function (data, callback, settings) {
$scope.dtOptions.aoColumns = [];
$scope.dtOptions.aoColumns.push(
{'mData' : data.students, 'sTitle': 'Date'} ///append columns
),
.withOption('serverSide', true)
.withOption('aoColumns', [
{'mData' : 'Class', 'sTitle': 'FooTitle'}, // first init columns
])
}
The first columns init looks fine but when the second columns append from the Ajax will lead to some data missing example The first init nTFoot: footer but second load became nTFoot: null. This lead to my table unable to display the footer.
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
I'm not familiar with Angular, I'm afraid, but this SO thread may help - it seems in the same area.
Colin