This is a migrated thread and some comments may be shown as answers.

Save page state in database as json

1 Answer 164 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Binu
Top achievements
Rank 1
Binu asked on 01 Nov 2019, 07:59 AM
Hi All,
I want to save my page state in sql database. I am using Kendo UI and React jS. i want to save data as json format,
 If i login that application again i want to load my page as last session state

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 05 Nov 2019, 06:27 AM

Hello, Binu,

In React, the entire concept is involved around keep the application state up the date in a JSON object.

What I can suggest is keep the state in a single object which will be saved in the database.

This can be done with state management libraries like Redux, MobX or using the React built-in context API:

https://reactjs.org/docs/context.html

As the components do not keep an internal state, they only received it from the application, when the current state has to be saved, save the same state that is passed to the component to the SQL database.

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Binu
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or