Automate count in scroller when there's no more data

Automate count in scroller when there's no more data

tacman1123tacman1123 Posts: 57Questions: 16Answers: 0

The count query is the slowest part of my database query when using the scroller.

What I'd like to do is skip the count query (that is,not return a total in the ajax), but have the library continue to make ajax requests until there's no more data.

Obviously, the scrollbar wouldn't be accurate -- it'd look like it was near the end, then as more data is fetched it would adjust. This seems to be common in other infinite scrolling systems.

Perhaps I could simulate this on the server-side -- the first time it makes a request I'd return a number higher than the records_per_page, but then when it requested that I'd change that number, until I run of out data, and then I'll know the actual count. But that way feels pretty messy, so I figured I'd post it here for discussion first, maybe there's already a solution.

Thanks.

Replies

  • allanallan Posts: 56,888Questions: 1Answers: 9,042 Site admin

    Hi,

    This indeed has come up a couple of times already, but it isn't something that is currently possible I'm afraid. Those paging calculations are fairly embedded into DataTables.

    Allan

Sign In or Register to comment.