Datagrids are not playing nicely

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
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Datagrids are not playing nicely

Post by cusingerBUSCw5N » Sat Dec 01, 2012 4:24 am

I am almost done with my app - and somehow a datagrid from one card got copied onto another card.

I would like to delete it. However, if I do, then it messes up the datagrid on the correct card. So I decided to set it for visible=false and ignore it - but if you click anywhere on the "bad" card and it performs the tasks that the datagrid is supposed to do.

I set the size to be 10 wide and 10 high and put it in a corner of the bad card - but it ignores the size and when you click anywhere on the "bad" card and it performs the task that the datagrid is supposed to do. Also, when you go in application, to get the datagrid to be visible, it won't appear (despite moving the location or changing the size of visible). It's like a ghost haunting the card.

I deleted the datagrid and started a new one. It picked up a datagrid from yet another card and used its row behavior - (from datagrid1 on another card).

This is truly beginning to annoy me.....that or it's Halloween and someone's having a good joke. :twisted:

I would like to either delete the unwanted duplicate datagrid on one page OR delete both of them and start over, but not have it mess up yet another datagrid.

Please tell me what's going on here...... This happened once before early in the process of developing this app and I basically started the whole app again. I'm way too far into it to do that please...

Thank you.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Datagrids are not playing nicely

Post by cusingerBUSCw5N » Sat Dec 01, 2012 4:55 am

I may have cured it. Found a reference that said that if any group (and datagrids are groups) is on more than one page, Livecode automatically considers the backgroundbehavior to be set to true

so I put this on the "bad" card:
set the backgroundbehavior of group "datagrid 2" to false
and made visible=false
and maybe we can live peaceably together.

I still would like to know how to get it off one page without destroying another..

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Datagrids are not playing nicely

Post by dunbarx » Sat Dec 01, 2012 5:03 am

Hi.

Not sure what happened to you with the DG, but it is not so that a group placed on multiple cards automatically has its backgroundBehavior set to "true".

Make a new stack. Male a new group. Make a few new cards.

The group is only seen on cd 1. Now copy that group to cd 2. It is identical, but a different object with a different ID. It will not appear on any others, and its backgroundBehavior is the default, "false".

Or I have it wrong. What did you do?

Craig Newman

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Datagrids are not playing nicely

Post by cusingerBUSCw5N » Sun Dec 02, 2012 6:33 am

I have no idea what I did - but suddenly there was a datagrid from another card living where it wasn't supposed to be. Because I know that messing around with datagrids and groups causes me trouble, I thought that I would just leave it there and hide it rather than deleting it. But later I realized that when I clicked on any part of the page, it started responding as if the datagrid was active on that page. I tried making the vis false, I tried making the size of it tiny - nothing.

I tried doing what you said - and all kinds of crazy things started happening. New datagrids picked up the behavior script of existing datagrids - with all the code. Setting up a new datagrid - it automatically named it the name of a different datagrid.... crazy things.

As I said - this has happened to me before. Anyway, I found on the BYU online information the note about the background issue - and sure enough, the code has stopped the problem. I still have the phantom datagrid living on the wrong page, but it is doing so quietly now.

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

Re: Datagrids are not playing nicely

Post by Klaus » Sun Dec 02, 2012 12:35 pm

Hi Carolyn,
cusingerBUSCw5N wrote:I still would like to know how to get it off one page without destroying another..
select the datagrid and then choose "Remove group" from menu "Object".
You can later "PLACE" that (or any other REMOVEd) group again with the same menu: Place group -> Name of your group


Best

Klaus

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Datagrids are not playing nicely

Post by cusingerBUSCw5N » Mon Dec 03, 2012 4:51 am

Wow! You are wonderful!

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

Re: Datagrids are not playing nicely

Post by Klaus » Mon Dec 03, 2012 12:11 pm

I know! 8)

Post Reply