ParamQuery Grid
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Search
Login
Register
ParamQuery grid support forum
»
General Category
»
Help for ParamQuery Pro
»
Storing states in database
« previous
next »
Print
Pages: [
1
]
Author
Topic: Storing states in database (Read 258 times)
queensgambit9
Pro Ultimate
Sr. Member
Posts: 347
Storing states in database
«
on:
May 13, 2025, 01:16:55 pm »
Hi
I am currently using states (localstorage). Is there a tutorial or example on how to instead store in database along with user data. Using MySQL/PHP.
Thanks in advance.
Logged
paramvir
Administrator
Hero Member
Posts: 6394
Re: Storing states in database
«
Reply #1 on:
May 13, 2025, 08:05:26 pm »
There is no demo for saving it in db as the process also involves user authentication to tie / associate the state with the user.
If you have user authentication already in place, then the process is quite simple:
first receive the state as string with saveState method and pass save: false to the method so as to avoid saving it to localStorage.
post the state string to remote url along with user token id and save it in a single field corresponding to the user in a table.
Get the state corresponding to the user whenever required and use loadState method to restore the state of the grid.
https://paramquery.com/pro/api#method-saveState
https://paramquery.com/pro/api#method-loadState
Logged
Print
Pages: [
1
]
« previous
next »
ParamQuery grid support forum
»
General Category
»
Help for ParamQuery Pro
»
Storing states in database