- changed status to resolved
Paging > 100 Problem
Issue #2
resolved
Hi, there's a small bug when trying to show more than 100 items. This is the problem:
def paging(self, qs):
""" Paging
"""
limit = min(int(self.request.POST.get('iDisplayLength', 10)), 100)
start = int(self.request.POST.get('iDisplayStart', 0))
offset = start + limit
return qs[start:offset]
Basically, even if iDisplayLength is 1000, min(1000, 100) == 100 and thus only the first 100 items will be returned.
Thanks!
Comments (3)
-
repo owner -
reporter Ha, sorry, thanks!
-
reporter If I may add, it's common thing to add "-1" in iDisplayLength for "All" results. I've hacked my code to handle that, but maybe you can come with a better solution : )
- Log in to comment
This is already fixed, check newest version. See: https://bitbucket.org/pigletto/django-datatables-view/src/193bb675349644ac6fda9d2bd970848c768fec4b/django_datatables_view/base_datatable_view.py?at=master#cl-57