How can I save the whole table to database?

Tags: #<Tag:0x00007f8b28c7dc50>

Hi, the situation is like this,

there are two buttons, one named ‘save’, the other named ‘load’.

When I finished designing the table, I would click the ‘save’ button, and the table will be saved to databse, not only the data, but also table styles, such as background color, merged cells, etc.

When I need to modify it again, I press the ‘load’ button and the table will be loaded(from database,not the localStorage or persistentState). I can continue to change it on the basis of the before.

I don’t know which method I can use, I have tried to use ‘getSettings()’, but it too large to save in the database…Is there any better ways? Thanks. :grinning:

Hi Jeremy,

There’s no build in way to save everything to the database. The usual use case is the other way around.

You would have to do something similar to what persistentState currently does. Observe hooks that you’re interested in and gather the data for future “save” operation. That’s what most of the frameworks does, sync to store and save the app state. Or save “on change”, when hooks are called. There are so many approaches to this that we have to leave it in the hands of developers.

Kind regards,
Wojciech

Thanks for your reply.