Local persistence vs server persistence in datatables editor examples

Local persistence vs server persistence in datatables editor examples

gs2589gs2589 Posts: 11Questions: 3Answers: 0

My questions is more of a conceptual one than a technical detail one. I noticed that on the datatables editor examples, if I make a change, that change is not erased if I refresh the page, or even if I close the browser and reopen it. This is true if I am signed in, or not, and even in incognito mode.

I'd like to implement this type of functionality on my own tables, so that my users don't loose data if they close the browser.
I am particularly curious about how this works when the user is not signed in. Does the datatables database save records with some sort of browser identifier?
Initially, I thought that something like the [Ajax Override example] was required to explicitly save stuff to local storage, but I notice that almost all other examples provide this functionality without saving stuff explicitly.

Thanks!

Replies

  • allanallan Posts: 63,160Questions: 1Answers: 10,406 Site admin

    Basically, the Editor examples don't have any authentication on them - in a "real" application you would need user login / session information before writing to the table, but the Editor demo just doesn't do that.

    However, having a single database of demo data for everyone around the world to play with isn't going to end well. So what the Editor demo site does is have a large number of identical databases (200 I think at the moment) that it can draw from. It assigned one to you when you load the demos initially and it will erase the database after 4 hours (or something) of inactivity. So if you make some changes and then come back in the morning, those changed should be gone.

    Likewise, starting an incognito session, or another browser should give you another pool database (make some changes in your browser in normal mode, then load the same page in incognito mode - they shouldn't be there - at least - its unlikely, even if technically possible, since it will reuse the databases if the pool runs out!).

    Probably more information than you were looking for...

    Allan

  • gs2589gs2589 Posts: 11Questions: 3Answers: 0

    Thanks so much! This is great! Im in love with this tool. Still learning it but so far its a beauty!

This discussion has been closed.