local SQL table as data source?

local SQL table as data source?

rexhavocrexhavoc Posts: 2Questions: 0Answers: 0

HI all,
New to datatables, been searching and reading for a couple days - maybe I'm asking the wrong questions?
I have a phonegap app that is only occasionally connected. I would like to use local SQLite table on the client as the data source for a datatable.

Any guidance appreciated,

rexhavoc

Replies

  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin

    I don't see an issue with that. How do you normally read data out of a local SQL table? Just use that same approach and feed the data through to DataTables. If you need guidance on using a local SQL table for offline storage, I would suggest asking somewhere like StackOverflow as it is outside the scope of this forum.

    Allan

  • rexhavocrexhavoc Posts: 2Questions: 0Answers: 0

    Hi Allan,
    Normally I loop over the result set and append html to the tbody then refresh.
    I was wondering if something could be done more efficiently with the data option.

    thanks,

  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin

    You could use row.add() or rows.add() to basically do the same thing. You can give it an HTML -tag tr` element to parse, or for better performance just give it the data structure expected for the row.

    Allan

This discussion has been closed.