Hello
I started working with LiveCode last week and am working on my first program. I am curious if I can do something similar to the two images below with DataGrids. I want to have a grid with a list of info, when I select a row I would like it to drop down and display more data. I would actually like the additional data to be a series of buttons, not just text. Possible, or should I look in to an alternate way to do this?
Before:
After:
Thank you in advance!
A question about Data Grids
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: A question about Data Grids
Hi,
Welcome to the forum.
In answer to your question - Yes. DataGrids can be manipulated to work in the way you require. You have to use the 'form' version of them (set on the Inspector panel) and then modify the 'Row Template' to have the basic bits you need. Then you will need to change the 'Row Behaviour' to update your data correctly and to handle the 'dgHilite' change to the 'height' of your row.
Now, the fun part is that even though I know this can be done and I'm pretty sure that there might also be some example/lesson/tutorial/demo of this out there I couldn't find it before I posted this. I personally don't know exactly how to do it, but I know it will involve making the layout for a row change and in there altering the visibility (show/hide) of your extra data (text/buttons/etc) and forcing the row to be taller to accommodate the extra controls. What I haven't figured out is how to force the layout change (LayoutControl) to happen with the pControlRect parameter. I'm sure some other more DataGrid knowledgable person will add that info here for you.
Look under the Runrev Lessons for Data Grid and have a really good read of it to get the hang of the 'form' version of the DG.
I hope that helps a bit,
Dave
Welcome to the forum.
In answer to your question - Yes. DataGrids can be manipulated to work in the way you require. You have to use the 'form' version of them (set on the Inspector panel) and then modify the 'Row Template' to have the basic bits you need. Then you will need to change the 'Row Behaviour' to update your data correctly and to handle the 'dgHilite' change to the 'height' of your row.
Now, the fun part is that even though I know this can be done and I'm pretty sure that there might also be some example/lesson/tutorial/demo of this out there I couldn't find it before I posted this. I personally don't know exactly how to do it, but I know it will involve making the layout for a row change and in there altering the visibility (show/hide) of your extra data (text/buttons/etc) and forcing the row to be taller to accommodate the extra controls. What I haven't figured out is how to force the layout change (LayoutControl) to happen with the pControlRect parameter. I'm sure some other more DataGrid knowledgable person will add that info here for you.
Look under the Runrev Lessons for Data Grid and have a really good read of it to get the hang of the 'form' version of the DG.
I hope that helps a bit,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
-
- Posts: 2
- Joined: Tue Apr 02, 2013 5:57 pm
Re: A question about Data Grids
Very cool. Thanks a bunch! I figured this was possible, but wanted to make sure before I dug too deep.
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: A question about Data Grids
While looking for something else I found the lesson you need:
http://lessons.runrev.com/s/lessons/m/d ... d-contract
Hope that helps.
Dave
http://lessons.runrev.com/s/lessons/m/d ... d-contract
Hope that helps.
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.