Responsive DataTable

42 views
Skip to first unread message

Komal Shah

unread,
Apr 27, 2019, 5:14:34 AM4/27/19
to ang...@googlegroups.com
Hi ,
I am currently facing responsive issue with jquery datatable Below is the code which is being used.
The responsiveness does not work if I make an ajax call

this.dtOptions = {
          pagingType: 'full_numbers',
          pageLength: 2,
          serverSide: true,
          processing: true,
           
          ajax: (dataTablesParameters: any, callback) => {
            that.http
              .post<DataTablesResponse>(
                dataTablesParameters, {}
              ).subscribe(resp => {
                that.persons = resp.data;
     
                callback({
                  recordsTotal: resp.recordsTotal,
                  recordsFiltered: resp.recordsFiltered,
                  data: []
                });
              });
          },
          responsive:true,
          columns: [{ data: 'id' }, { data: 'firstName' }, { data: 'lastName' }]
        };

Can help is highly appreciated.
Also other options than jquery datatable?
Reply all
Reply to author
Forward
0 new messages