l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.57k stars 486 forks source link

Child rows issue with server side #1657

Closed joseserrano15 closed 2 years ago

joseserrano15 commented 2 years ago

Hello. I'm trying to implement child rows, but when I use server side its not working because the child data is show bottom the table. If I use static data its work perfectly, only fails with server side. Any idea what could be the problem?

Child row with server side image

Child row with static data image

ServerSide code image

advapiIT commented 2 years ago

Hello, I've got the sasme problem here, where you able to resolve?

Thanks

joseserrano15 commented 2 years ago

Yes, I could resolve it. You need to use rowCallback.

image

image

_renderer variable is private _renderer: Renderer2

joseserrano15 commented 2 years ago

I forgot it, the ajax callback must be:

callback({ recordsTotal: resp.recordsTotal, recordsFiltered: resp.recordsFiltered, data: resp.data });

Not like the example callback({ recordsTotal: resp.recordsTotal, recordsFiltered: resp.recordsFiltered, data: [] });

advapiIT commented 2 years ago

Can you please give me the url of the original sample?? Thanks in advance

Il Ven 8 Lug 2022, 18:37 jose serramo @.***> ha scritto:

I forgot it, the ajax callback must be:

callback({ recordsTotal: resp.recordsTotal, recordsFiltered: resp.recordsFiltered, data: resp.data });

Not like the example callback({ recordsTotal: resp.recordsTotal, recordsFiltered: resp.recordsFiltered, data: [] });

— Reply to this email directly, view it on GitHub https://github.com/l-lin/angular-datatables/issues/1657#issuecomment-1179177945, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDZBJWERQGVT6FQNHNAS4DVTBKLRANCNFSM5XFNX4HQ . You are receiving this because you commented.Message ID: @.***>

joseserrano15 commented 2 years ago

Server side: https://l-lin.github.io/angular-datatables/#/basic/server-side-angular-way

Original DataTables detail: https://datatables.net/examples/server_side/row_details.html