How to apply Row and Column Templates to Datgagrid

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

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 4:57 pm

Nope. You mentioned a card. A "namely" card. I did some web work. Can't find that. What "card" holds the fields such that they show up in the datagrid.

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by Klaus » Thu Apr 14, 2016 5:15 pm

bbhank wrote:Nope. You mentioned a card. A "namely" card. I did some web work. Can't find that.
Come on, now you're making fun of me! :D

Hey I am not a native english speaker but nevertheless know the term "namely", which may be
seldom used but it is just an adjective and not special KIND of card or whatever you migh have thought.
bbhank wrote:What "card" holds the fields such that they show up in the datagrid.
Sigh...
The card we were talking about for hours -> the card that you posted a screenshot of.
The card you added objects to (insted to the group "Row template" on that namely (sic!) card).
The card that opens after you click "Row template..." in the inspector for your datagrid.
The card with the actual "Row template" group in the stack "Data Grid Templates XXXXXX".

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 5:16 pm

The one that doesn't put the items into the datagrid!!

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by Klaus » Thu Apr 14, 2016 5:17 pm

Cards usually don't do anything by themselves, unless you tell them... 8)

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 5:22 pm

Think about it! If it worked as either you or the information I have so far, says, we wouldn't be here!!
I've been through the suggested materials and much more looking, and if the answer was readily available there would have been no need to ask here.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 5:24 pm

Where do you put the items drug onto the template so that they will show up in the grid is the issue? How do you get them to show up? Where are the steps for that, if there's some tutorial or whatever?

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: How to apply Row and Column Templates to Datgagrid

Post by sritcp » Thu Apr 14, 2016 6:40 pm

bbhank wrote:Where do you put the items drug onto the template so that they will show up in the grid is the issue? How do you get them to show up?
I think you are not reading the instructions or Klaus's comments carefully.
It is also a good idea to use the LiveCode terminology to avoid further confusion.
For example,
bbhank wrote:Yes. Over and over. How can you not?
There appear to be two fields here. Label and Background.
There are two controls, not fields; one of them is a field, the other (backGround) is a graphic.
Klaus wrote:You did read the little text at the bottom of that card, not?
The quote referenced by Klaus says " .... select the "Row Template" group and choose Object > Edit Group menu item"
Here, we have nested groups; you have to edit the correct group.
When you open the row template editor, it reveals a card containing the "Row Template" group.
The little instruction says that you have to open up that group to allow its contents to be edited.
If you don't do that, you will be adding your controls beside the "Row Template" group, not inside it. These won't show up!
I am not sure, but from the image you have attached to an earlier message, it appears that you have added the controls without opening the "Row Template" group for editing.
If you have done it correctly, the added controls should appear nested within the Row Template group (as shown in the Tutorial that we have been referring to):
rowTemplate.png
Regards,
Sri

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 7:54 pm

Check this out:
Row Template 2.png
.
None of these fields, buttons, anything else, show up anywhere but on the template.
That's been the problem all the time. I've followed the instructions many times, many variations, even, without success.

That's why I say, YES, I'm missing something. It's probably small but missed and keeps me from moving forward. This is harder than working with the datagrid after. I understand a lot about it, just have problem getting this part.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 8:15 pm

Come on, now you're making fun of me! :D
C'mon, now. I gotta get mine too. It works both ways. :P

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by jacque » Thu Apr 14, 2016 8:35 pm

@bbhank, are you familiar with how groups work? To create an object inside a group, you need to first select that group and then turn on group editing. The card appearance will change, only the objects in the group will show. Create your objects in that view, then stop editing. The steps are:

Select the group. You can do that three ways:
1. Make sure the "Select Grouped" icon in the toolbar is NOT bold and then click on any object in the group.
2. Select the group in the application browser
3. Select the group in the Project Browser

When the group is selected, go into edit mode. You can do that two ways:
1. Choose "Edit group" from the Objects menu
2. Click the "Edit group" icon in the toolbar

When the card view changes and only shows the objects inside the group, you are in edit mode. The window title will also say "(background 'group id xxxx')'" as verification. Drag objects and arrange your layout. When you are done, leave edit mode. You can do that in either of the two ways you used to start editing. The card appearance will return to normal and the window title will revert to just the name of the stack.

This is basic LC behavior, unrelated to datagrids, and applies to all groups in any stack. The User Guide explains more about editing groups on page 109.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by SparkOut » Thu Apr 14, 2016 8:38 pm

If you edit the group containing the objects desired on the datagrid form, so that any new objects you create to use on the form are definitely within the group, they should show up. If you add a field, change its properties to have a solid border, for instance. Change the size of the background graphic.
Save the row template.
In the datagrid property inspector make sure the fixed row height is turned off.
Back in the row template fill in data handler you will need to add extra lines to populate the data from each element of the array to your extra controls.
The layoutControl handler can be used to resize and align the controls on your DG form, for instance if you want to shrink/expand each row according to how much data needs to be displayed.
If you are still having trouble, tomorrow I will try to make a demo that you can pick apart.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Thu Apr 14, 2016 9:04 pm

Oh thank you. It finally worked in a blank new document. I still don't see what I did though. That's why I keep saying I'm the one who is missing something. You're helping me get on track. This is the needed stuff. I'm gone also but my email gets alerts whenever someone posts to this group.

Thank you. Thank you.

I'll be going back through your instructions til I get it "right", whatever that is :). I know they work, just if I can do it.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: How to apply Row and Column Templates to Datgagrid

Post by MaxV » Fri Apr 15, 2016 9:23 am

Hi all,
I made a video explaining the datagrid customization procedure, here is the link: https://youtu.be/VNSHLOjE6r8
Now it should be clear for all. :D
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Fri Apr 15, 2016 1:13 pm

Thank you for all the work.
Your instructions were spot on all the time. I found something weird about my system. I kept starting over and starting over, building stacks from scratch, tryin to get it to work step by step from the instructions, yours, Klaus, the lessons n tutorials. I had started another stack that had data in the grid itself that showed up as a table. When I switched to a form, the fields that had been drug into the template appeared. So I went back and started yet another fresh stack. Same thing UNTIL I put one character in the datagrid itself. As soon as I hit return or left the field, any controls, objects, that were in the datagrid showed up. So I put just a space in the actual datagrid, and now everything works as I have been asking for. I don't know what having a character in the actual datagrid does but it now works, and works quite swell. The drag n drop features are actually there. I have an AMD processor and that does cause some differences. This might have caused the issue. I don't know but now with the space it works, and without it does not.

The other important thing needed was unlock the row height, duhhh. This isn't related to the problem though, just something that if forgotten can make one think the fields didn't appear. They do unless there is a weird problem like this space issue, just off the row where you can't see em, unless you uncheck the box that freezes the row height.
Submissions Test Screen.png
Ever heard of this space issue though?

Thank you.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: How to apply Row and Column Templates to Datgagrid

Post by bbhank » Fri Apr 15, 2016 1:42 pm

Ok. I know the stack ain't pretty. Workabilly first, then MAYBE some looks. :P

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”