How to pass prefetched Data to DataTable, instead of using apiEndpoint?
const apiUrl = "https://yourapirul";
const element = document.querySelector("#kt_remote_table");
const dataTableOptions = {
apiEndpoint: apiUrl, //want to avoid this approach, and pass the Data directly
pageSize: 5,
columns: {
status: {
....
Hi Stefan Njegomirovic
it's designed to either fetch data from a server via apiEndpoint or extract data from the existing HTML table. However, there isn't a direct way to pass prefetched data through the configuration.
Could you please try this approach?
You can create a proxy or mock endpoint that returns your prefetched data without making an actual network request:
https://gist.github.com/faizalmy/8551fec14d880622e44004387d8ecf5c
We intercept all fetch calls to our specific mock URL.
Thanks