Page 1 of 1

Datagrid persistent data setting

Posted: Sun Jun 06, 2010 11:35 pm
by phaworth
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

Re: Datagrid persistent data setting

Posted: Mon Jun 07, 2010 5:35 pm
by trevordevore
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.

Re: Datagrid persistent data setting

Posted: Wed Jun 09, 2010 5:52 pm
by phaworth
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

Re: Datagrid persistent data setting

Posted: Wed Jun 09, 2010 5:55 pm
by trevordevore
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.

Re: Datagrid persistent data setting

Posted: Wed Jun 09, 2010 6:11 pm
by phaworth
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.

Re: Datagrid persistent data setting

Posted: Wed Jun 09, 2010 6:49 pm
by trevordevore
Is this file basically serving as your pref file?

Re: Datagrid persistent data setting

Posted: Wed Jun 09, 2010 7:30 pm
by phaworth
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