Hi everyone,
I'm using the Metronic theme (bootsrap) with KTDataTable in a .NET 8 Core project. I have successfully implemented server-side pagination, but I'm having trouble passing custom parameters (e.g., idCompany and idWallet) to the backend.
I've tried to use the mapRequest configuration to override the body. her an example:
const dataTableOptions = {
apiEndpoint: apiUrl,
requestMethod: "POST",
mapRequest: {
body: (body) => {
console.log("Original Body:", body);
let newBody = {
...body,
idCompany: this.clienteSelezionato.id,
idWallet: this.idWalletSelezionato
};
return newBody;
}
},
No logs are printed.
Can you please help me ?
FM WhatsApp is a modified version of the original WhatsApp, created by Fouad Mokdad, that offers advanced privacy options and full customization features. Unlike the official app, FM WhatsApp lets you hide your online status, blue ticks, typing indicator, and even prevent others from deleting messages. It also allows you to apply custom themes, change fonts and icons, and lock specific chats without using a third-party app. Since it's not on the Play Store, download FM WhatsApp from fmwhsapp to get the latest safe version.
Hi Fabio Drago
Thank you for sharing your solution - it will definitely help others who might face the same issue.
Hello,
the mistake was in the mapRequest body porperty.
The correct way is:
const dataTableOptions = {
apiEndpoint: apiUrl,
requestMethod: "POST",
mapRequest: (query) => {
console.log("Original Query:", query); // Debug per verificare i dati iniziali
query.set('idCompany', this.clienteSelezionato.id);
query.set('idWallet', this.idWalletSelezionato);
console.log("Modified Query:", query); // Debug per verificare che i parametri siano stati aggiunti
return query;
},
Kind regards,
Fabio Drago