Datagrid missing data
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid missing data
Whew.
At least it was not 42.
When you recreated the array from scratch, did you use the original data? Why not create a new with an array of equal size, and with each element just, say, the character "X".
Craig
At least it was not 42.
When you recreated the array from scratch, did you use the original data? Why not create a new with an array of equal size, and with each element just, say, the character "X".
Craig
Re: Datagrid missing data
Why not 42?
This is the code I used.
repeat for each key tKey in OriginalArray
--if tKey is 16 then
--put "16" into sKey
add 1 to sKey
put trimWS(sKey) into tNewArray[sKey]["data1"]
put trimWS("NONE") into tNewArray[sKey]["data2"]
put trimWS("NONE") into tNewArray[sKey]["data3"]
put trimWS("NONE") into tNewArray[sKey]["data4"]
put trimWS("NONE") into tNewArray[sKey]["data5"]
put trimWS("NONE") into tNewArray[sKey]["data6"]
put trimWS("NONE") into tNewArray[sKey]["data7"]
put trimWS("NONE") into tNewArray[sKey]["data8"]
put trimWS("NONE") into tNewArray[sKey]["data9"]
put trimWS("NONE") into tNewArray[sKey]["data10"]
--end if
--exit repeat
end repeat
The trimWS function is not needed but for troubleshooting purposes added it in.
PS: I have amended the names of the original array/code as this is for a third party and sorry to say can't release the stack presently. However, the help put forward from everyone is well appreciated. Thanks for being a great community.
Re: Datagrid missing data
Some more progress on this. With the above code the datagrid is dropping the LAST key. See attached screen shot of the inspectors contents and datagrid.
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Datagrid missing data
What does TrimWS do?
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: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid missing data
Aha.
So it is not the 16th that matters, but the "last". This seems to me as well to be something in the data.
Why not 42?? Really??
Craig
So it is not the 16th that matters, but the "last". This seems to me as well to be something in the data.
Why not 42?? Really??
Craig
Re: Datagrid missing data
@ Craig Nope, What happened here? Key/line 42 had issue's in the past?function trimWS pText
-- Remove all leading and trailing whitespace characters.
-- I.E., space, tab, carriage return, line feed, form feed.
return replaceText(pText,"(^\s+)|(\s+$)",empty)
end trimWS
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Datagrid missing data
Some problems can be solved easily with nothing more than a brief description of the issue. This does not appear to be one of those.
If you can post an example stack with data that exhibits the issue I'll bet we can resolve this quickly.
If you can post an example stack with data that exhibits the issue I'll bet we can resolve this quickly.
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: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid missing data
Yes.
It has been a silly running mini-joke on this forum for a decade.
42 is the result of multiplying 6 by 9.
Craig
It has been a silly running mini-joke on this forum for a decade.
42 is the result of multiplying 6 by 9.
Craig
Re: Datagrid missing data
well, that was one of the questions proposed that gives the answer "42".
Another was many roads must a man walk down before he becomes a man And so on...
Context:
In their travels, Arthur comes to learn that the Earth was actually a giant supercomputer, created by another supercomputer, Deep Thought. Deep Thought had been built by its creators to give the answer to the "Ultimate Question of Life, the Universe, and Everything", which, after eons of calculations, was given simply as "42". Deep Thought was then instructed to design the Earth supercomputer to determine what the Question actually is.
If you haven't read the trilogy of 5 books called The hitchhiker's guide to the galaxy your life is incomplete
Another was many roads must a man walk down before he becomes a man And so on...
Context:
In their travels, Arthur comes to learn that the Earth was actually a giant supercomputer, created by another supercomputer, Deep Thought. Deep Thought had been built by its creators to give the answer to the "Ultimate Question of Life, the Universe, and Everything", which, after eons of calculations, was given simply as "42". Deep Thought was then instructed to design the Earth supercomputer to determine what the Question actually is.
If you haven't read the trilogy of 5 books called The hitchhiker's guide to the galaxy your life is incomplete
Re: Datagrid missing data
The good news.
I appear to have found a clue to the issue. Not sure if it is a bug or other. Maybe someone can answer. I had the property "fixed row height" selected for the datagrid. As soon as I deselect it the missing row data comes through. I'm sure this is not normal behaviour.
@ Craig - 42!.....Should of got that. Sorry a bit tired today. To be fair not read the books but seen the movie. Maybe time to give the books a go.
I appear to have found a clue to the issue. Not sure if it is a bug or other. Maybe someone can answer. I had the property "fixed row height" selected for the datagrid. As soon as I deselect it the missing row data comes through. I'm sure this is not normal behaviour.
@ Craig - 42!.....Should of got that. Sorry a bit tired today. To be fair not read the books but seen the movie. Maybe time to give the books a go.
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Datagrid missing data
It's normal behavior. A fixed height means that each row will be the same size. If there is more text than will fit in the height of the row, the extra will fall below the bottom border and you won't see it.
You can fix the problem by ensuring the row height is set to accommodate the largest amount of content you expect. If you do not use a fixed row height then the datagrid has to determine that value itself which can slow down its display.
You can fix the problem by ensuring the row height is set to accommodate the largest amount of content you expect. If you do not use a fixed row height then the datagrid has to determine that value itself which can slow down its display.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid missing data
The movie was awful, the books, especially the first two, are wonderful.To be fair not read the books but seen the movie.
Big difference.
Craig
Re: Datagrid missing data
Thanks for this Jacque, I have reactivated the fixed row height and all appears to be working now. I have spent the last hour trying to recreate the circumstances that caused the issue as I'm uncomfortable giving over an app that could run into this issue along the line. Saying that I have been unable to get the same error/issue reoccur so far.jacque wrote: ↑Mon Mar 08, 2021 6:14 pmIt's normal behavior. A fixed height means that each row will be the same size. If there is more text than will fit in the height of the row, the extra will fall below the bottom border and you won't see it.
You can fix the problem by ensuring the row height is set to accommodate the largest amount of content you expect. If you do not use a fixed row height then the datagrid has to determine that value itself which can slow down its display.
I'm leaning towards maybe there being a corrupt piece but of data that was entered and that caused the initial issue but this is inconclusive and would prefer finding a concrete reason. So will continue to investigate the core reason for the error/issue and add a little more code to check for corrupt keys/data.
Thanks for your help all and will update if I find a concrete reason on this as to help someone else.
@ Craig - Maybe when I get some free time I'll give the books a go. Maybe year 2042