I'm tring to have a csv download button and need to exclude a couple of columns from table.
I've found a exportOptions defines which columns should be exported. this option comes from jQuery datatalbles and table.column() method is likely to be used to select columns.
now I need to select certain columns, but I couldn't find out how with angular-datatables way.
anyone knows solution?
<table dt-options="dtOptions" dt-column-defs="dtColumnDef">
<thead>
<tr>
<th>hoo</th>
<th>hoo</th>
</tr>
</thead>
<tbody>
<tr>
<td>hoo</td>
<td>hoo</td>
</tr>
</tbody>
</table>
<script>
// here is inside my controller
$scope.dtOptions = DTOptionsBuilder
.newOptions()
.withDOM('tB')
.withButtons([
{
text: 'download csv',
extend: 'csv',
exportOptions:
{
// columns: I neet to select certain columns here
// wiht method like "table.columns(0)" mentioned in jQuery datatables document
// but I don't know how in angular-datatables
}
}]);
</script>
I use angular-way to render table.