Angular 8 server-side datatable with Laravel framework

Angular 8 server-side datatable with Laravel framework

elrodriguez24elrodriguez24 Posts: 2Questions: 0Answers: 0

Hello, I am trying to list the data that comes from an api in Laravel, I am using Yajra and it returns a result in this way

in component.ts the following code:

in html:

Apparently the page works but it does not show the registers despite the fact that in console

I hope you can help me please

Replies

  • kthorngrenkthorngren Posts: 21,468Questions: 26Answers: 4,977
    edited February 2020

    Seems like the const details = JSON.parse(JSON.stringify(resp.original)); is not necessary as you are encapsulating then decapsulating the same data. I think const details = resp.original; will produce the same result and be more efficient with large data sets.

    You will want to read the Server Side docs to understand the required parameters. You are missing some expected parameters in the callback. You have data: [] but it probably should be data: details.data and you also need to add the draw parameter.

    Kevin

  • elrodriguez24elrodriguez24 Posts: 2Questions: 0Answers: 0
    edited February 2020

    thank you very much it works correctly nothing more with data: details.data

This discussion has been closed.