Paging > 100 Problem

Issue #2 resolved
Dominic Savoie created an issue

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)

  1. Dominic Savoie 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 : )

  2. Log in to comment