Datagrid missing data

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

istech
Posts: 194
Joined: Thu Sep 19, 2013 10:08 am

Datagrid missing data

Post by istech » Fri Mar 05, 2021 9:51 am

Hi All,

I have run into a datagrid problem and I need to know if it is a bug our maybe some other issue. I have used datagrid's for a while now but this issue has me stumped. Currently I have a datagrid that has been set with data. I then update the array and then set the datagrid with the new array. However there is one record which will not display/missing. No matter what I do "Reset" or "Refresh" the new record will not show. I have even done a breakpoint on the missing key during "FillData" but as soon as the draw/fill is complete that new record is lost. I have checked the data is there and is correct in "contents" so not to sure what the problem could be.

Any ideas?

Many Thanks
Last edited by istech on Fri Mar 05, 2021 5:08 pm, edited 1 time in total.

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Datagrid missing data

Post by stam » Fri Mar 05, 2021 2:43 pm

Hi istech,
When i've had problems like this before, it's because i forgot the array has to be a numbered array...

I'm sure you haven't done that, can you post the code that updates the datagrid?

S.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Datagrid missing data

Post by dunbarx » Fri Mar 05, 2021 3:47 pm

Hi.

You update by setting either the "dgData' or the "dgText" of the group?

And before either of these commands are executed, you are saying, perhaps stepping through, in the line just before, you see the record of interest intact, and yet that single record does not load?

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Datagrid missing data

Post by FourthWorld » Fri Mar 05, 2021 3:51 pm

Bonus for setting by dgText rather than array: DG will add the numeric index for you when it converts the text to its internal array format. And you can easily see all of the data in any field if needed.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

istech
Posts: 194
Joined: Thu Sep 19, 2013 10:08 am

Re: Datagrid missing data

Post by istech » Fri Mar 05, 2021 5:07 pm

stam wrote:
Fri Mar 05, 2021 2:43 pm
Hi istech,
When i've had problems like this before, it's because i forgot the array has to be a numbered array...

I'm sure you haven't done that, can you post the code that updates the datagrid?

S.
Definitely a numbered array and checked in the breakpoint to confirm. Very strange. I use the dgdata to set the datagrid as below.
put the cAllData of widget "MyControl" of cd "MAIN" into tAllArray

set the dgData of grp "MyDataGrid" to tAllArray

--dispatch "ResetList" to grp "MyDataGrid"

dispatch "RefreshList" to grp "MyDataGrid"
Definitely a scratch your head moment. :?

@ Craig, yes I have stepped through the fillData script on the template script and watched the data being filled and the field in question does get populated. But during the (I suppose) refresh of the datagrid the new line gets dropped. Just very strange to see. I'm considering creating a new datagrid to see if the problem exists.

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Datagrid missing data

Post by stam » Fri Mar 05, 2021 5:41 pm

Not sure if it's any help, but it may be worth checking the dgCache custom property in the data grid property inspector.

This will show you the current dgData of the data grid, would be interesting to know if all the lines you expect are there because your code suggests suggests they should be...

S.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Datagrid missing data

Post by FourthWorld » Fri Mar 05, 2021 5:44 pm

It may be useful to see what the DG thinks it's working with, by obtaining the DG's dgText.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Datagrid missing data

Post by dunbarx » Fri Mar 05, 2021 6:52 pm

I usually use the dgText instead of the dgData, but I do not think it ought to matter.

It also ought not to matter whether, when stepping through, you see your data either in the clear or in the array variable. If it is there, it ought to stay there.
I have stepped through the fillData script on the template script and watched the data being filled and the field in question does get populated.
What field? I thought we were talking about verifying the contents of a variable JUST before setting the dgText or dgData property of the group, based on that about-to-be-loaded variable.

Craig

istech
Posts: 194
Joined: Thu Sep 19, 2013 10:08 am

Re: Datagrid missing data

Post by istech » Fri Mar 05, 2021 11:19 pm

Yes the field is the one I have from the row template. So I put a breakpoint at the row that is missing and the array fills the field for that row. I can see it in the variable view and data is fine. Just gets dropped on the refresh. Which I have no idea why. I'm considered maybe a corrupt array. But even when I delete and recreate the array the same thing happens and it's just one row that is missing. I'll try some more experiments to try and re-create the same issue. But really strange problem.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Datagrid missing data

Post by FourthWorld » Sat Mar 06, 2021 12:04 am

Probably not a corrupted array. More likely something in the source data for that record that isn't what you expect.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Datagrid missing data

Post by dunbarx » Sat Mar 06, 2021 5:32 pm

Richard may be on to something.

Is it possible, for example, that there is a hidden return char somewhere? That might misalign the relationship among the data.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Datagrid missing data

Post by FourthWorld » Sat Mar 06, 2021 5:51 pm

With no code or data exemplifying the issue shared here, our hands are tied with finding any truly relevant solution.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

istech
Posts: 194
Joined: Thu Sep 19, 2013 10:08 am

Re: Datagrid missing data

Post by istech » Sat Mar 06, 2021 7:38 pm

Hi All,

I have been doing some testing today and can rule out a data problem. I have recreated the array from scratch and added "NONE" to every data point. I have 16 keys in the array and it only happens when key 16 needs to be applied. If I change key 16 to 17 the data comes through fine. This only happens if the key is 16 in a sequenced run of keys in an array. Just never seen this before. :?
Last edited by istech on Sat Mar 06, 2021 7:57 pm, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Datagrid missing data

Post by dunbarx » Sat Mar 06, 2021 7:53 pm

Whew.

At least it was not 42.

Craig

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Datagrid missing data

Post by bogs » Sat Mar 06, 2021 7:54 pm

istech wrote:
Sat Mar 06, 2021 7:38 pm
I have been doing some testing today and can rule out a data problem. I have recreated the array from scratch and added "NONE" to every data point. I have 16 keys in the array and it only happens when key 16 needs to be applied. If I change key 16 to 17 the data comes through fine. This only happens if the key is 16 in a sequenced run of keys in an array. Just never seen this before. :?
I haven't seen this before either, but I have seen something similar in nature of weirdness when sending to a menu to pick "help" of all things.

The wind up to that one was that you could not just send "Help" because for some reason, Lc internally translated that to "menupick 15" ! I wonder if something similarly goofy is happening here?
Image

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”