Trying to do client side lazy loading using Indexeddb

Trying to do client side lazy loading using Indexeddb

sbudasbuda Posts: 1Questions: 1Answers: 0

Greetings, I've been using datatables for some time now, but I have only recently started working with IndexedDB. For the most part the two work together pretty nicely, however, I have run into a bit of a problem.

What I want to do is load data from a local database, but not all at once. The reason is that it loads thousands of records which is quite slow. Instead, I would like to do with indexedDB what I have been doing server side- where I send over a chunk of records and a total count of how many records there actually are. DataTables is able to use those two peices of information to paginate correctly.

However, this uses the fnAjaxSource option which takes a url. I need to to take a function that returns data somehow. I haven't found anyone doing quite the same thing. Currently I am using DataTables 1.9 for the project, however, I would be able to user 1.10 for this and similar pages if that is required. However, going through the API and documentation hasn't shown me any ways to tell DataTables to expect more records than it receives. If there is any other information you need from me please let me know, but I can't really post an example since I don't know what I'm doing. I'm hoping there's an easy option, or some way I could write a plug in that does this, but I haven't seen anything that gives me hope.

This discussion has been closed.