I am using dataTables in angular 6 the is coming fine and displaying it perfectly as expected. but if i click on pagination or changed the page length or search anything it doesn't send any parameter with api like it does in jquery dataTable
here is my code
component.ts file
import { Component, OnInit } from '@angular/core';
import { adminLteConf } from '../admin-lte.conf';
import {Http} from "@angular/http";
import { HttpClient, HttpResponse } from '@angular/common/http';
import { HttpHeaders } from '@angular/common/http';
import { DataTableDirective } from 'angular-datatables';
@Component({
selector: 'app-listmasterlog',
templateUrl: './listmasterproducts.component.html',
styleUrls: ['./listmasterproducts.component.css']
})
export class ListmasterproductsComponent implements OnInit {
public data: any[];
public filterQuery = "";
public mfRowsOnPage = 10;
public mfActivePage: any;
public sortOrder = "asc";
dtOptions: DataTables.Settings = {};
metaData:any;
constructor(private http: Http) { }
ngOnInit(): void {
this.dtOptions = {
//pagingType: 'full_numbers',
processing: true,
serverSide: true,
pageLength:10,
language: {
lengthMenu: "_MENU_",
paginate: {
first:'',
last:'',
next: '<i class="fa fa-chevron-circle-right">', // or '→'
previous: '<i class="fa fa-chevron-circle-left">' // or '←'
}
},
dom: '<t><"bottom"p><"inline-flex" li><"clear">',
ajax:(dataTablesParameters:any, callback) => {
this.http.get(
adminLteConf.APIURL+"?io=masterprod&action=list",
dataTablesParameters
).subscribe(resp=> {
var resposnse = resp.json();
this.data = resposnse['data'];
//console.log(this.packages);
callback({
recordsTotal: resposnse['meta'].total,
recordsFiltered: resposnse['meta'].pages,
data: []
});
});
}
// columns: [
// { data: "RecordId"}, {data: 'PackageName'}, {data: 'Price'}
// ],
};
}
}
This is what i am getting in header when i check the network section inside inspect element
http://example.com/webapi/?io=masterprod&action=list&value=®ex=false
I am googling it from last three days but found nothing.
The above image is of my tables pagination displaying perfectly data coming fine but the functionality is not working. Everytime i click on pagination or changed the length the api hit but without any parameters