By default all AdaptableState (both design time through Predefined Config and run-time through grid activity) is persisted in localStorage, and AdapTable manages the saving and fetching as required.
However - as this example illustrates - by leveraging the State Options you can persist state to a remote datastore (which we do here to Firebase).
There are 4 methods in State Options that you can use:
- loadState: Allows the customization of state loading.
- applyState: Allows hooking into AdaptableState hydration
- saveState: Allows the customization of the state that is going to be persisted
- persistState: Allows the customization of state persistence
In this demo we provide implementations for the loadState and persistState functions to save State in Firebase instead of localStorage.
Note: The configuration below is shared with everyone who uses this page. So you can open another browser tab at this url and play around with the AdapTable instance below in one tab (e.g. add searches, change layout, etc). Then if you reload the other tab everything should be synchronized and pick things up from where they were in the initial tab.