Datagrid persistent data setting
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Datagrid persistent data setting
The Datagrid manual describes the Persistent Data setting as "Set to true if you would like the data grid to store the data being displayed between sessions. The
data grid always works with data stored in a script local variable but if this value is true then the data will be cached in a custom property as well".
Does this apply to standalone applications? I'm under the impression that custom property values are not preserved between runs of a standalone application without invoking the splash stack/application stack workaround.
Thanks,
Pete
data grid always works with data stored in a script local variable but if this value is true then the data will be cached in a custom property as well".
Does this apply to standalone applications? I'm under the impression that custom property values are not preserved between runs of a standalone application without invoking the splash stack/application stack workaround.
Thanks,
Pete
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Datagrid persistent data setting
The data will still be stored in the custom property but it won't be saved to the stack file unless you explicitly save the stack file yourself.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Datagrid persistent data setting
Thanks Trevor. The reason for asking is that I've just run into the issue that data, including custom properties, cannot be saved in a standalone app and working on finding ways around that. The persistent data setting made me wonder if you had found a way round that, aside from the usual recommendation of having an initial splash stack that just calls the real application stack.
Pete
Pete
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Datagrid persistent data setting
I don't know of any other approach other than the one you mention. I *always* store data outside of the application itself (in user folders) and then load the data up when the application launches. Less chance of headaches regarding permissions this way.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Datagrid persistent data setting
I agree with always storing stuff outside the app. I use an sqlite db for the user data but got caught with the issue of custom property settings that need to survive across runs. I've changed everyting to store such settings in an external file now and used setProp and getProp handlers in my main stack's script to deal with keeping the file in sync with the custom props.
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Datagrid persistent data setting
Is this file basically serving as your pref file?
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Datagrid persistent data setting
Actually, I have two files, both in the user's Preferences folder (using Sarah Reicheldt's script to get the path to it on Mac and Windows). I use a settings.txt file to hold preferences and a properties.txt file to hold the info about custom properties with persistant data. Using two files mainly because the format is a little different and also just because seems like properties are a different beast than preferences. Doing this means I don't have to use the splash/app stack separation which I wasn't keen on for a number of reasons.
Turns out I don't need to use the persistent data option for datagrids due to the logic of my app.
Pete
Turns out I don't need to use the persistent data option for datagrids due to the logic of my app.
Pete