Page 1 of 1

Polygrid data corruption?

Posted: Thu Feb 13, 2025 1:28 am
by strongbow
Has anyone else seen data corruption when using the Polygrid when deleting/adding rows and/or modifying the columns? I had some weird issue with multiple new empty columns being added. After deleting these new columns I now can't seem to access the data or text of the polyGrid and just get errors such as:

864,7,14,No matching handler for arguments with types (<type: livecode.lang.array>,<type: __builtin__.cbool>) - possible handlers (MCArithmeticEvalNumberFormattedAsString,MCLogicEvalBoolFormattedAsString)
865,7,14,E:/Projects/GitHub/LiveCode-LTD/summer-mega-bundle/src/PolyGrid/com.livecode.widget.polygrid.lcb
866,7,14,3200
897,7,14,1
456,7,14
465,7,14
253,7,14

Any help appreciated. Thanks!

Re: Polygrid data corruption?

Posted: Thu Feb 13, 2025 1:11 pm
by stam
The commonest error with polygrid I've encountered is that data is
a) not numerically indexed
b) indexes do not start from 1 and are not sequential

Look at the data within the inspector to ensure this is an numerically indexed array starting from [1] and using sequential numbers.
It does mean if manipulating the array directly you need to re-sequence the array every time (I use a simpler handler at stack level for this).
This is a major disadvantage compared with the DataGrid, which has no such hiccups...

Stam

Re: Polygrid data corruption?

Posted: Thu Feb 13, 2025 11:28 pm
by strongbow
Thanks but the problem with the data corruption is that I can't now actually access any of the data at all, even though it's visible in the PG. Weird. Luckily I had previously exported the data, so could reset the text to empty and import the saved data...

Might be time to revert to the DG...

Re: Polygrid data corruption?

Posted: Fri Feb 14, 2025 12:36 am
by dunbarx
The polygrid is supposed to be one of the bright stars of the "new" LC. A simpler, good looking (all as opposed to a table field), but still very handy DG substitute. I was just getting ready to start using them. It is a problem if it is not stable.

Craig

Re: Polygrid data corruption?

Posted: Fri Feb 14, 2025 4:24 am
by strongbow
One of the annoying things with new controls is the plethora of options in a non-LC-code style.

eg. we should be able to:

sort control "pgControl" by column 2 numeric descending

or something similar. Different control script interfaces leads to hard-to-use, unintuitive scripting. These are the types of integration tasks that are key, IMO, to making the power of new controls accessible for all, rather than the few who explore them enough to discover their power. Never mind the bugs (though I'm sorta dismayed to see LCB errors appear).

Just my 2c. Cheers!

Re: Polygrid data corruption?

Posted: Fri Feb 14, 2025 8:54 am
by FourthWorld
strongbow wrote:
Fri Feb 14, 2025 4:24 am
One of the annoying things with new controls is the plethora of options in a non-LC-code style.

eg. we should be able to:

sort control "pgControl" by column 2 numeric descending

or something similar. Different control script interfaces leads to hard-to-use, unintuitive scripting.
There was an initiative a while back to address that with new syntax handling they called "open language". Not sure what happened with that.

viewtopic.php?t=24500

https://use-livecode.runrev.narkive.com ... n-language#

Re: Polygrid data corruption?

Posted: Fri Feb 14, 2025 9:01 am
by strongbow
Yeah, nice one. "a while ago" = 10 years.... How time flies.

Re: Polygrid data corruption?

Posted: Fri Feb 14, 2025 12:20 pm
by Klaus
Did someone already bug report the issues in the first posting? 8)

Re: Polygrid data corruption?

Posted: Fri Feb 14, 2025 8:16 pm
by PBH
I have used the PolyGrid in multiple projects now and I’ve found it to be very useful and reliable. The only time I’ve seen any type of corruption was if I tried to import unsuitable data. I have only deleted columns on a few occasions and I did’t see any problems at the time, but that was from a relatively small amount of data though.

When you say you can’t access the data, how are you trying to access the data?

Can you still see the data in the Contents section of the Object Inspector? You should be able to inspect the text and the pgData of the PolyGrid.

Have you tried to export the csvData of the PolyGrid and inspect it for bad data?

Paul

Re: Polygrid data corruption?

Posted: Sat Feb 15, 2025 1:41 am
by strongbow
Couldn't see the data in the inspector.
Couldn't access either pgText nor pgData - errored out.

Haven't reported the error as haven't spent the time to reproduce in a shareable stack, unfortunately.