A question about Data Grids

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
gardenlevel
Posts: 2
Joined: Tue Apr 02, 2013 5:57 pm

A question about Data Grids

Post by gardenlevel » Tue Apr 02, 2013 6:17 pm

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:
IMG_2741.PNG
Before
After:
IMG_2742.PNG
After
Thank you in advance!

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: A question about Data Grids

Post by dave_probertGA6e24 » Tue Apr 02, 2013 8:17 pm

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
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

gardenlevel
Posts: 2
Joined: Tue Apr 02, 2013 5:57 pm

Re: A question about Data Grids

Post by gardenlevel » Tue Apr 02, 2013 10:01 pm

Very cool. Thanks a bunch! I figured this was possible, but wanted to make sure before I dug too deep.

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: A question about Data Grids

Post by dave_probertGA6e24 » Thu Apr 04, 2013 11:26 am

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
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Post Reply