swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.63k stars 1.68k forks source link

Server side paging should just work of rows without index #293

Open mmrath opened 8 years ago

mmrath commented 8 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior

With server side paging data table expects data in index position relative to the page. For example for second page with page size 10, it expects rows with index 11 to 20 in the data rows. However implementations in almost all backend services generally return an array of 10 objects with index 0-9.

Expected behavior

Data table should just display data in all rows from start(0) to end(9) in case of server side paging. I am referring to example at line 42-46 https://github.com/swimlane/angular2-data-table/blob/master/demo/paging/paging-server.ts

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

sachinofficial commented 7 years ago

This would be a issue only when dealing with huge data, for small set of records you could just maintain the data in-memory and work with it. But yeah would be much better if we could just render table based on the number of records in hand. +1 for this feature.

dallinski commented 7 years ago

This looks to be the same issue as #138.

PatrickHuetter commented 7 years ago

I think both should be possible. Holding the data in memory and also fetching on each page change.