Datagrid missing data
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Datagrid missing data
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
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.
Re: Datagrid missing data
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.
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.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid missing data
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
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
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Datagrid missing data
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Datagrid missing data
Definitely a numbered array and checked in the breakpoint to confirm. Very strange. I use the dgdata to set the datagrid as below.
Definitely a scratch your head moment.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"
@ 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.
Re: Datagrid missing data
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.
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.
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Datagrid missing data
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid missing data
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.
Craig
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.
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.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.
Craig
Re: Datagrid missing data
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.
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Datagrid missing data
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid missing data
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
Is it possible, for example, that there is a hidden return char somewhere? That might misalign the relationship among the data.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Datagrid missing data
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Datagrid missing data
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.
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.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid missing data
Whew.
At least it was not 42.
Craig
At least it was not 42.
Craig
Re: Datagrid missing data
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.istech wrote: ↑Sat Mar 06, 2021 7:38 pmI 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.
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?