I am using AngularJS with Angular-datatables (http://l-lin.github.io/angular-datatables/) and I am using the datatables ColVis plugin. The table renders fine but sorting the column headers OR using the ColVis show/hide columns removes all data:
I have a table within an Angular controller
<div ng-controller="withColVisCtrl">
<table datatable dt-options="dtOptions">
<thead>
<tr>
<th>Col 1</th>
<th>Col 2</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="value in value_list">
<td>col 1 data</td>
<td> col 2 data</td>
</tr>
</tbody>
</table>
withColVisCtrl uses the controller:
angular.module('myApp').controller('withColVisCtrl', function ($scope, DTOptionsBuilder) {
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withBootstrap()
.withColVis()
.withDOM('C<"clear">lfrtip')
.withColVisOption('aiExclude', [1]);
});
When I click on a column heading OR use the ColVis show/hide then the table seems to redraw but with no data.
My data is coming through an API so it's different to the Angular-Datatables ColVis examples (http://l-lin.github.io/angular-datatables/#/withColVis).
What am I missing here?
