Saving aaData into localStorage

Saving aaData into localStorage

alexoulualexoulu Posts: 2Questions: 0Answers: 0
edited January 2012 in General
Hello,
I'm implementing a web application that at the moment it's only client-side. I get the data to be loaded on Datatables from a js array of objects that is saved/loaded into/from LocalStorage.
I'd like to see an example of how the aaData can be modified through jeditable and then return the same js array of objects to be saved into LocalStorage.

Thanks in advance.

This is a code snippet from my app. Datatables take as data source the object report from the array of objects unit.
By the way, I noticed that most of the examples provided are mainly with server processing. Is it possible to add few more client side only examples?

$('#demo' + unit.n).html('

Replies

  • allanallan Posts: 63,195Questions: 1Answers: 10,412 Site admin
    That's a really interesting approach. I'm actually planning to write a blog post that will hopefully be useful to you in the next couple of days as it deals with using mDataProp as a function, whereby it can effectively use another data store for storing and loading data.

    Until then, take a look at the code documentation for 1.9.0.dev.3 (there are a few changes in this area over beta 2): https://github.com/DataTables/DataTables/blob/master/media/src/model/model.defaults.columns.js#L329

    Allan
  • alexoulualexoulu Posts: 2Questions: 0Answers: 0
    edited January 2012
    Thanks very much Allan,
    I appreciate your prompt reply and I take this chance to congratulate with you for the wonderful job done so far building up this community.
    I am sure that with a more complete support (with many examples of different possible uses of Datatables) this plugin will become the most popular for commercial and non-commercial projects.

    A possible solution of last issue i posted:

    In order to modify the properties' values of the js array of objects I was passing as data source to datables, each time the user edits a cell also the js array of objects should be updated. (before I could only edit the table generated from datatables and not storing the modification).

    [code]

    $('#demo' + unit.n).html('
This discussion has been closed.