Datagrid not showing it's 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: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
lohill
Posts: 761
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Datagrid not showing it's data

Post by lohill » Fri Jul 03, 2020 8:16 pm

I have a table data grid that has 14 columns and 27,405 rows. The data is not visible and yet I can go into the IDE and under Datagrid-Contents see all the data. If I try Datagrid - Refresh Data the data still remains invisible. I can use 'set the dgText of group "DataGrid 1" to empty' and then reload the data. The data is still not visible even though the grid shows its vertical scroll bar and can be scrolled. I can use 'put the dgDataOFIndex[tIndex] of group "DataGrid 1" into tArray and see the data. I am pretty confident I could delete the data grid and create new one but there must surely be something easier that I can do. Any suggestions?

Thanks,
Larry

Klaus
Posts: 12204
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Datagrid not showing it's data

Post by Klaus » Sat Jul 04, 2020 11:57 am

Hi Larry,

quick guess, maybe you came to any display limitation?
Since in RAM everything seems to be working OK.

Try with fewer records to be sure.


Best

Klaus

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

Re: Datagrid not showing it's data

Post by dunbarx » Sat Jul 04, 2020 1:55 pm

Klaus,

I don't think this can be an issue, after all, we are not in the 1980's. Even with 27,000 lines and 14 columns, and even with 100 chars per DG field, that is still only around 40MB.

But the test might be interesting anyway. So Larry, make a copy, (I assume this one will also not show anything) get the DGText, delete half the lines, and restore the DGText back into the DG. But I bet the information does not just appear.

Unless it does. In that case, we need to tell Trevor.

Craig

Klaus
Posts: 12204
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Datagrid not showing it's data

Post by Klaus » Sat Jul 04, 2020 2:26 pm

Hi Craig,
dunbarx wrote:
Sat Jul 04, 2020 1:55 pm
Klaus,

I don't think this can be an issue, after all, we are not in the 1980's.
Even with 27,000 lines and 14 columns, and even with 100 chars per DG field, that is still only around 40MB.
sure, but it is not the amount of data, the number of object MIGHT be the problem, so I just want to exclude this issue.
27000 * 14 = 378000 fields in the datagrid!


Best

Klaus

lohill
Posts: 761
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Re: Datagrid not showing it's data

Post by lohill » Sat Jul 04, 2020 3:39 pm

Klaus and Craig,

I copied DataGrid 1 and pasted it on the same card and changed its name to DataGrid 2. It showed no visible data. In the Inspector, under Contents, I can see all the data. I deleted all but 5 lines of the data in DG2 and refreshed the data. Still nothing visible but the vertical scrollbar does not show. Lines 1 through 5 can be selected but not line six. I can get the dgDataOfIndex for any of the five lines and see the array data.

While doing all this I noticed in the Project Browser that the box that shows the number of lines in in the script for my button called "My Default Column Behavior" is RED. That button is associated with DG1. I have never seen that before so I'm not sure what to try next but there is something that LC does not like. That button is mostly used for formatting 'fill-in' data

Larry

SparkOut
Posts: 2407
Joined: Sun Sep 23, 2007 4:58 pm

Re: Datagrid not showing it's data

Post by SparkOut » Sat Jul 04, 2020 4:00 pm

Unless things have changed in more recent versions of LiveCode, copy and paste is often the Vulcan Death Grip to a datagrid. It sounds like things have not really changed since the last versions I was using when I was last working with datagrids. I think it is because LiveCode loses track of the relationship between IDs of all the myriad individual objects that go together to make up the datagrid control.

Sometimes you can clone a datagrid successfully. I think sometimes you can copy and paste the Datagrid Template stack that is created when you add a datagrid. Usually it is far better to create from scratch and then set properties according to whatever template you have for the structure. I suspect this is your issue.

If you delete the datagrid and recreate it from scratch, I wonder if you will get the data visible again.

lohill
Posts: 761
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Re: Datagrid not showing it's data

Post by lohill » Sat Jul 04, 2020 4:28 pm

Spark Out,

My experience with datagrids has me agreeing to everything you have said. Over the years I have experienced this same thing and always just deleted the datagrid and started over. This is not a fun thing to have to do so I had hopes that someone else might have a simpler solution. Now that I have discovered that there is a probable error in my Default Column Behavior button maybe just replacing that button will solve it. I am sort of waiting to see what others say before trying that.

Larry

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

Re: Datagrid not showing it's data

Post by dunbarx » Sat Jul 04, 2020 5:48 pm

Be sure to save the DGData somewhere before you do anything rash. When you say "not fun", I interpret that to mean rewriting those billions of fields that Klaus mentioned.

But LC says that the number of objects in a stack is "unlimited".

Craig

lohill
Posts: 761
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Re: Datagrid not showing it's data

Post by lohill » Sat Jul 04, 2020 6:33 pm

Craig et al,

Found it and as usual it was operator error. I went to the code for the button "My Default Column Behavior" (the one that was red in the Project Browser). On the surface everything looked as I thought it should (no red dots). I added a blank line to one of my sections of code and then pressed 'Apply". I then got a red dot next to "on doubleMouseUp" indicating an error. A quick inspection and I discovered there was no "end mouseDoubleUp". I'm not sure how I lost it but it now is working just fine.

Larry

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”