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

angular 7 server side true dtbuttons having no data

Open awais2080 opened this issue 7 years ago • 2 comments

I'm submitting a...


[ ] Big Unseen  Bug report 
[might be  true ] Feature request 
[ yes ] Documentation issue or request
[ ] Dear i have been struggling with angular datatable serverside for quite a long i have full command without serverside but without serverside its none of use as we cant fetch all data once you are programmer you know memory resources for server is limited. 
problem with this is i tried exactly the same as provided in document for angular server side but result is not positive 

Current behavior

Expected behavior

when button with csv or pdf should be clicked data must be shown there .

Minimal reproduction of the problem with instructions

ID First name Last name
{{ person.id }} {{ person.firstName }} {{ person.lastName }}
No data!

import { Component, OnInit } from '@angular/core'; import { HttpClient, HttpResponse } from '@angular/common/http'; import { DataTableDirective } from 'angular-datatables'; class Person { id: number; firstName: string; lastName: string; }

class DataTablesResponse { data: any[]; draw: number; recordsFiltered: number; recordsTotal: number; } @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent implements OnInit { title = 'dtserver'; dtOptions: DataTables.Settings = {}; persons: Person[]; constructor(private http: HttpClient) {} ngOnInit(): void { const that = this;

this.dtOptions = {
  pagingType: 'full_numbers',
  dom: 'lBfrtip',
  pageLength: 10,
  serverSide: true,
  processing: true,
  ajax: (dataTablesParameters: any, callback) => {
    that.http
      .post<DataTablesResponse>(
        'https://angular-datatables-demo-server.herokuapp.com/',
        dataTablesParameters, {}
      ).subscribe(resp => {
        that.persons = resp.data;

        callback({
          recordsTotal: resp.recordsTotal,
          recordsFiltered: resp.recordsFiltered,
          data: []
        });
      });
  },
  columns: [{ data: 'id' }, { data: 'firstName' }, { data: 'lastName' }]
};

}

}

Environment


- node version:  v10.10
- angular version: 7.2.0
- angular-cli version: 7.2.0
- jquery version: 3.3.1
- datatables version:   1.10.19
- angular-datatables version: 7.0.0

image image image

awais2080 avatar Mar 17 '19 18:03 awais2080

@l-lin dear plz see this last time this is the issue holding me to launch the live plz help me do this i have no other possible solution or alternative to this functionality been provided here plz :(

awais2080 avatar Mar 17 '19 18:03 awais2080

https://github.com/l-lin/angular-datatables/issues/1382 solution can be found here

awais2080 avatar May 19 '19 23:05 awais2080