Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question 1
Is it possible to have a look at the whole content of
local_storage
for an app, so I have an idea if all is working as expected?Question 2 / Request
Do you think it is possible to bind the value of a component to a value in
local_storage
?I would like to do something like this in the
__init__
of a form:and have
self.text_box_1.text
populated when the form is created and its value saved to local storage whenever it changes. Perhaps the values should be saved when the form is hidden... but this would fail to save if the user closes the page without hiding the form. Perhaps they should be saved as soon as they are changed... I don't really know what would be the best behavior.Thoughts?
Use case
All my forms have this in
__init__
:and this called when any of the component values changes:
Some forms have 20-30 of these lines, one for each value I want to remember, for each checkbox, dropdown, etc. in the form. The whole app can have hundreds of items stored in
local_storage
.Having
local_storage.bind_component
would still require the 20-30 lines in__init__
, but would not require the definition ofdef update_local_storage(self):
on each form and calling it whenever some component value changes.These snippets come from the
DefineCrates
form that has 5 DataGrids, one of them calledpanels_page
that comes with a drop down calledpanels_page_size
. Here you can see 9 of the values stored inlocal_storage
, there are more in the hidden tabs.Beta Was this translation helpful? Give feedback.
All reactions