DataGrid Stays when moving to another card
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
DataGrid Stays when moving to another card
Hello, not sure if this has occurred to anyone, but when I am in the IDE of LiveCode testing going to a regular/non datagrid card from a datagrid card, the datagrid card dissapears.. When I create a standalone app it acts very strange and the datagrid stays on top of the new destination card (the way it appears to me anyway). Does anyone know how to fix this or where I should look to troubleshoot. If you need any additional information please let me know, thanks.
Re: DataGrid Stays when moving to another card
Hi.
Are you saying that if you have a dataGrid on cd 1, and nothing on cd 2, that in a standalone that dataGrid appears on cd 2?
Craig Newman
Are you saying that if you have a dataGrid on cd 1, and nothing on cd 2, that in a standalone that dataGrid appears on cd 2?
Craig Newman
Re: DataGrid Stays when moving to another card
Apologize for confusion.
I have a dataGrid on cd 1, and just a regular card with some fields and submit button on cd 2. In standalone the dataGrid appears on cd2 when I go from cd 1 --> cd 2, in livecode development tool it only shows cd 2 (as I wish).
I have a dataGrid on cd 1, and just a regular card with some fields and submit button on cd 2. In standalone the dataGrid appears on cd2 when I go from cd 1 --> cd 2, in livecode development tool it only shows cd 2 (as I wish).
Re: DataGrid Stays when moving to another card
Hmmm.
On a Mac?
I made a test stack, though I knew what to expect. No DG on cd 2.
No surprise to me. I cannot believe this is only in my world, or only in the Mac worlds.
Craig Newman
EDIT. I did indeed make a standalone.
On a Mac?
I made a test stack, though I knew what to expect. No DG on cd 2.
No surprise to me. I cannot believe this is only in my world, or only in the Mac worlds.
Craig Newman
EDIT. I did indeed make a standalone.
Re: DataGrid Stays when moving to another card
I have Windows 7 Home Premium running Livecode 7.1.0.
I will try to see what might be going, maybe just some messed up code. I will post again if I find anything. Thanks
I will try to see what might be going, maybe just some messed up code. I will post again if I find anything. Thanks
Re: DataGrid Stays when moving to another card
Hi.
I am on a Mac, OSX 10.9, LC 6.8.
Craig
I am on a Mac, OSX 10.9, LC 6.8.
Craig
Re: DataGrid Stays when moving to another card
So I did some more testing and it seems that the new card is never being activated after all. So when I am on card "dataGridCard" and I want to go to card "newCard" I doubleclick on the icon in the row. I removed all the code just trying to get the card to open. Is there a special way to get a card to open. This works in the IDE, but not in standalone app. I did test a button on the "dataGridCard" and it works fine.
It activates this on row behavior script:
Thanks for any help
It activates this on row behavior script:
Code: Select all
on mouseDoubleUp pMouseBtnNum
if pMouseBtnNum is 1 then
if the dgProps["allow editing"] of the dgControl of me then
switch the short name of the target
case "editButton" --is the icon button name
go to card "newCard"
break
end switch
end if
pass mouseDoubleUp
end mouseDoubleUp
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
Re: DataGrid Stays when moving to another card
Just to see if you can get there, try this. It might help find the trouble.
Code: Select all
on mouseDoubleUp pMouseBtnNum
if pMouseBtnNum is 1 then
if the short name of the target is "editButton" then go to card "newCard"
end if
end mouseDoubleUp
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
Re: DataGrid Stays when moving to another card
Thanks for the tip, I tried what you said with little modification to make sure I was doubleclicking the correct button:
It did pop up the name of the target, but didn't go anywhere. Once again for whatever reason it works in the LiveCode IDE, but not standalone.
Any ideas?
Code: Select all
on mouseDoubleUp pMouseBtnNum
if pMouseBtnNum is 1 then
answer the short name of the target
if the short name of the target is "editButton" then go to card "newCard"
end if
end mouseDoubleUp
Any ideas?
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
Re: DataGrid Stays when moving to another card
I looked thru the release notes for 7.1.1 and didn't see anything specific to this. You might want to load it anyway just to eliminate the possibility.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
Re: DataGrid Stays when moving to another card
So just to test I made a totally new card, new datagrid, new button, field, and test button to load data in the grid. Put it in a standalone and it seems to work! lol
I guess that means all my other cards with Datagrids I have this setup on are corrupt and I have to rebuild them. I am not sure how they got corrupt.
Hopefully I can fix, thanks for your help. I will report if can't get it to work.
I guess that means all my other cards with Datagrids I have this setup on are corrupt and I have to rebuild them. I am not sure how they got corrupt.
Hopefully I can fix, thanks for your help. I will report if can't get it to work.
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
Re: DataGrid Stays when moving to another card
Did you copy/paste any code? The LC editor doesn't like curly quotes. I would try replacing the " in your code. It's not very common for things to get corrupt. I've been working with LC for a lot of years and never had a corrupt situation.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
Re: DataGrid Stays when moving to another card
Hey quailcreek, your totally correct. It wasn't corrupt, unfortunately I discovered after rebuilding the whole datagrid card pieces and testing bits of coding one by one. In the end it was one word that messed me up.
One of the pieces of code I had in on the "DataGridCard" was this:
Apparently this piece of code prevented me from going to my "NewCard". When I take it out I can go.
So I still need that action though so I changed it to "on closeStack" instead and now everything works. Is this a bug I should report or operating as designed.
Thanks for your continued support thru this issue.
One of the pieces of code I had in on the "DataGridCard" was this:
Code: Select all
on closeCard
set the dgData of group "DataGrid 1" to empty
put empty into field "addVar" --field on datagridCard
end closeCard
So I still need that action though so I changed it to "on closeStack" instead and now everything works. Is this a bug I should report or operating as designed.
Thanks for your continued support thru this issue.
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
Re: DataGrid Stays when moving to another card
What you've run into is that the code that is executing the go to cd script is in the behavior of the DG. So the DG code is still executing when you try to empty it. I think I've gotten around this before. Let me look thru some code and I'll see when I can find.
Why specifically do yo need to empty the DG when you leave the cd? Just so I might think of a way around this.
Why specifically do yo need to empty the DG when you leave the cd? Just so I might think of a way around this.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
Re: DataGrid Stays when moving to another card
Hello, maybe there is a better way but this is my thought process. I am open to suggestions for sure:
0. User enters the substack on the "DataGrid" Card
1. User Inputs a bunch of datagrid rows on this card
a. In this process they may need to(edit button earlier I was dealign with)/or forced to go to that NewCard in the same substack.
b. Currently they have the option in the upper right hand box of the card to hit X with their mouse to close the card
- When doing this it doesn't erase any of the data on the grid (without my closeCard code now)
2. When the user goes back into this card from the mainstack the data is still there which can cause issues.
Is there a way to get rid of that X at the top and I will just make an exit button on bottom to force them to push that perhaps?
I did notice now I can't get out of the card since I changed closeCard to closeStack, as I used closeStack prior to this, lol.
0. User enters the substack on the "DataGrid" Card
1. User Inputs a bunch of datagrid rows on this card
a. In this process they may need to(edit button earlier I was dealign with)/or forced to go to that NewCard in the same substack.
b. Currently they have the option in the upper right hand box of the card to hit X with their mouse to close the card
- When doing this it doesn't erase any of the data on the grid (without my closeCard code now)
2. When the user goes back into this card from the mainstack the data is still there which can cause issues.
Is there a way to get rid of that X at the top and I will just make an exit button on bottom to force them to push that perhaps?
I did notice now I can't get out of the card since I changed closeCard to closeStack, as I used closeStack prior to this, lol.