dataGrid help?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
dataGrid help?
I have a question about handling datagrids.
I currently have an app with 2 datagrids, 1 form 1 table, both working mostly as expected.
In the form dataGrid I have a disclosure button working to hide or show more of the data line.
My question is this. If the user changes any of the 6 fields that are on the portion of the line that is affected by the disclosure button, when they are hidden, then shown again the line reverts back to initial values. How do I lock the user changes in?
I know I've see how to do this somewhere, but i've been reading so much its all become a blur. Could someone point me to the right resource or post or video so I can re-read whatever it was and move on to my next steps?
Thanks in advance, all the help here is much appreciated.
Sturgis
I currently have an app with 2 datagrids, 1 form 1 table, both working mostly as expected.
In the form dataGrid I have a disclosure button working to hide or show more of the data line.
My question is this. If the user changes any of the 6 fields that are on the portion of the line that is affected by the disclosure button, when they are hidden, then shown again the line reverts back to initial values. How do I lock the user changes in?
I know I've see how to do this somewhere, but i've been reading so much its all become a blur. Could someone point me to the right resource or post or video so I can re-read whatever it was and move on to my next steps?
Thanks in advance, all the help here is much appreciated.
Sturgis
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
The lesson How Can I Store An Option Menu Value When The User Makes a Selection? shows how you can use SetDataOfIndex/SetDataOfLine to update internal values in a data grid.
Note that in the current version of the data grid SetDataOfIndex does not store your data in the cache if you have "persistent data" checked in the Property Inspector. If that is an issue for you then you can get/set the dgDataOfIndex/dgDataOfLine property of the data grid. See the Data Grid API
Note that in the current version of the data grid SetDataOfIndex does not store your data in the cache if you have "persistent data" checked in the Property Inspector. If that is an issue for you then you can get/set the dgDataOfIndex/dgDataOfLine property of the data grid. See the Data Grid API
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
Thank you very much, got it working. Seems relatively easy to manage now that you've handed me a clue.
Much appreciated.
Much appreciated.
trevordevore wrote:The lesson How Can I Store An Option Menu Value When The User Makes a Selection? shows how you can use SetDataOfIndex/SetDataOfLine to update internal values in a data grid.
Note that in the current version of the data grid SetDataOfIndex does not store your data in the cache if you have "persistent data" checked in the Property Inspector. If that is an issue for you then you can get/set the dgDataOfIndex/dgDataOfLine property of the data grid. See the Data Grid API
One more question if I may.
In a datagrid, table format. If I wish to set the numberformat for individual columns, must I setup custom column templates for each column? I need to be able to set a numberFormat on the fly while retaining the numeric sort for the column.
Any chance you could direct me to an example or resource again? Not sure why everything else has been so easy yet suddenly I'm struggling with things that are probably just as easy.
Thanks in advance (again) for any help.
Sturgis
In a datagrid, table format. If I wish to set the numberformat for individual columns, must I setup custom column templates for each column? I need to be able to set a numberFormat on the fly while retaining the numeric sort for the column.
Any chance you could direct me to an example or resource again? Not sure why everything else has been so easy yet suddenly I'm struggling with things that are probably just as easy.
Thanks in advance (again) for any help.
Sturgis
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
You can probabaly accomplish what you need by overriding the default behavior for table cells. This is easier than creating a custom template for each column. Take a look at this lesson which shows how to do just that:
How Do I Override the Default Behavior For Rendering Data to a Cell?
How Do I Override the Default Behavior For Rendering Data to a Cell?
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
Very cool, got things working well thanks! Am I blind, or was that part of the documentation a recent addition? Either way, thanks for leading me to it, and if its a recent add, thanks for that also!
Sturgis
Sturgis
trevordevore wrote:You can probabaly accomplish what you need by overriding the default behavior for table cells. This is easier than creating a custom template for each column. Take a look at this lesson which shows how to do just that:
How Do I Override the Default Behavior For Rendering Data to a Cell?
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact: