l-lin / angular-datatables

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

Upon using DataTable Directive in Angular, shows all data on first page itself (no pagination),on deleting any row it still persist on frontend upon page switch #1658

Closed Harshad-Lukare closed 2 years ago

Harshad-Lukare commented 2 years ago

Hi Team,

Datatable pagination not working upon performing any activity

1) ISSUE -1

I am Using DataTable Directive in angular (version 13), So in this I fetch data from the pubic api "https://api.covidtracking.com/v1/us/daily.json" and all data shows properly with DataTable pagination

But after refreshing page, it shows all data in first page itself (IT SHOULD SHOW ALL DATA WITH PAGINATION)

All Data shown with Pagination:

DataTable with pagination

After refresh Data shown by DataTable on one Page only:

Datatable not pagination-1

datatable not pagination-2

2) ISSUE 2:

When we click on delete button, selected row gets filter from data array, row gets deleted from frontend also. But upon page switch and come back to page, deleted row still persist in frontend view.

delete row in DT-1

After switch to another page and then back to previous page

DT row deletion-2

BELOW IS MY CODE:

File 1:html file

file1

File 2: .ts file file2

file2 Continued

file2 continued 3

Please check why DataTable shows this behavior upon deleting any row. Suggest some api by using which we solve pagination issue in angular(v-13)

shanmukhateja commented 2 years ago

Hello,

Try using this example https://l-lin.github.io/angular-datatables/#/basic/server-side-angular-way and see if this is fixed for you.

Can you provide a reproducible StackBlitz repo to investigate this?

Also, please note, I'm moving this issue as a "discussion".