Data Grid Row Template Button Problem

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Data Grid Row Template Button Problem

Post by TerryL » Wed Jan 29, 2014 8:41 pm

I've three questions after a project with data grids. Could anyone enlighten me? (Win7, LC6.5.1)

1) Somewhere during programming several data grid tables and forms, the property inspector's "Row Template" button starts going to the most recent substack card, not the appropriate card for the dg. I must navigate to the appropriate card. The "Row Behavior" button always works properly. The data grid works properly. I can't reproduce this in a clean stack. Where did I go wrong? Can the "Row Template" button be coaxed to go to the appropriate substack card?

2) The first data grid dragged from the tools palette to a stack creates the dg substack with TWO cards, the second card has the row template group and behavior script for the dg, but the first card, always id 1002, has no row template group or behavior script. What is the purpose of the first card?

3) When deleting the last dg in a stack, the warning dialog's "Yes" option (to delete dg and its substack cd) doesn't delete anything. The "No" option (to delete dg but leave its substack cd) deletes the dg, its cd, and the substack. I would have expected this action from the "Yes" button, or better still no dialog at all since it's the last dg and everything should be deleted anyway. Am I mis-interpreting the dialog?
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/openxtalk.html

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Data Grid Row Template Button Problem

Post by TerryL » Mon Feb 03, 2014 8:20 pm

I found the solution to question #1, the confused "Row Template" button. I struggled with this for weeks, and finally realized I had a preOpenStack handler in the mainstack's stack script that was trapping the substack when it opened up, executing commands meant for the mainstack. I fixed the problem with: if the owner of this stack = empty then.... Pesky substacks!

on preOpenStack
if the owner of this stack = empty then --mainstack
--do mainstack commands
end if
pass preOpenStack --let substack pass through
end preOpenStack

But what about #2 & #3 questions?
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/openxtalk.html

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Data Grid Row Template Button Problem

Post by Klaus » Tue Feb 04, 2014 1:18 pm

Hi Terry,

pesky substacks, aha! 8)
2.What is the purpose of the first card?
I have no idea and I really don't care! :D
3. Delete dg stuff YES NO
Just made a quick test and clicking YES deleted the dg and the substack and everything related to the dg!
Clicking NO only deleted the dg from the card!

So everything worked as exspected!?


Best

Klaus

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Data Grid Row Template Button Problem

Post by TerryL » Thu Feb 06, 2014 9:22 pm

Thanks Klaus for your reply. I can't explain it. I re-tested the dg delete dialog again with two data grids in a clean stack and everything worked as expected using the "Yes" button to delete dg + associated card + substack...never mind. (Win7, LC6.5.2) Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/openxtalk.html

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Data Grid Row Template Button Problem

Post by Klaus » Thu Feb 06, 2014 10:04 pm

One word: GREMLINS! :D

Post Reply