angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

Server side the Angular way and Using DT Extension not working together.

Open jit1992 opened this issue 8 years ago • 6 comments

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

jit1992 avatar Mar 15 '18 11:03 jit1992

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...

l-lin avatar Mar 15 '18 20:03 l-lin

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

doink1985 avatar Mar 16 '18 08:03 doink1985

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 avatar Mar 24 '18 08:03 jitdhar

jitdhar, can you show your html for this code?

doink1985 avatar Mar 24 '18 09:03 doink1985

<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>

jitdhar avatar Mar 24 '18 13:03 jitdhar

I have the same problem, were you able to solve it?

nervo84 avatar Apr 03 '22 14:04 nervo84