Datatables sourced from IndexedDB.

Datatables sourced from IndexedDB.

klukiyanklukiyan Posts: 2Questions: 1Answers: 0

Hi,
I'm trying to find a solution to source Datatables from IndexedDB with lazy loading. Something similar to ajax server-side processing but to be cliend-side processing with indexedDB.
So far I ended up firstly reading from indexedDB to JS object and then use it as data source for Datatables. Further data modifications are also successfully done by writing into the respective object and indexedDB. That works almost perfectly. With 8000 lines of data the data loads within 3 seconds (0.5 from indexedDB to JS object, and 2.5seconds rendering the datatables).
At some moment I may need to go beyond 8000 lines, and I would like to have the possibility to lazy-load data straight from indexedDB. Has anyone succeeded?

I've seen 1 example on forum with indexedDB, but that one uses same approach. There is also one example with localStorage, which also is not doing any lazyloading.

Thank you

Answers

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    Hi,

    You would need to use the ajax option as a function to be able to use an indexedDB source. Essentially that would override the default Ajax call and you can replace that will a call to indexedDB, building the required query based on the parameters given by DataTables.

    I'm not aware of anyone having published a script to do this, so if you do work on it yourself, I'm sure the community would appreciate if you were to publish it.

    Regards,
    Allan

This discussion has been closed.