Server side the Angular way and Using DT Extension not working together.
I'm submitting a...
[ ] Bug report
What versions you are using?
- node version:8.9.4
- angular version:5.2.6
- angular-cli version:1.6.4
- jquery version:3.3.1
- datatables version:1.10.16
- angular-datatables version:5.0.0
Current behavior
When i am trying to combine the functionality of Server side the Angular way and Using DT Extension. DataTable Extension not working properly. Column show hide property not working it only hiding the title of the column not the entire column.
Expected behavior
It should hide the full column of the table.
Minimal reproduction of the problem with instructions
What DT extension are you talking about? Besides, if it does not work, then it's more an issue with DataTables than with angular-datatables...
I have issues with reordering and hiding/showing columns. in case of reordering changes only order of names in headers, but information in table body just on the same place. in case of hiding columns, heades hide but table body again doesnt react
I solved it with my own. I set my options in the below way to solve the issue:-
this.dtOptions = {
pagingType: 'full_numbers',
pageLength: that.page_size,
serverSide: true,
processing: true,
ajax: (dataTablesParameters: any, callback) => {
that.http
.post<any>(
'https://angular-datatables-demo-server.herokuapp.com/',
dataTablesParameters, {}
).subscribe(resp => {
that.persons = resp.data;
callback({
recordsTotal: resp.recordsTotal,
recordsFiltered: resp.recordsFiltered,
data: resp.data
});
});
},
columns: [{ data: 'id' }, { data: 'firstName' }, { data: 'lastName' }]
],
dom: 'Bfrtip,Rf',
buttons: [
'colvis'
],
};
Don't set *ngFor in html view the data array will generate rows.
jitdhar, can you show your html for this code?
<table datatable [dtOptions]="dtOptions" class="row-border hover">
<thead>
<tr>
<th>ID</th>
<th>First name</th>
<th>Last name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
I have the same problem, were you able to solve it?