In this particular case, the table being displayed in the polygrid is based on datasets that researcher loads into our application and the number of rows and columns can vary widely as well as the column names/labels and type of data. Rather than conduct a large analysis to determine which of N columns (and it could be 0 to N) have changed, it is easier to update pgColumns.

In one dataset N could be 3 and in the next 1500 (yes, for real)



On 8/24/2023 4:53 PM, Bob Sneidar via use-livecode wrote:
Why not get the pgColumns first, alter only the array element needed for the 
specific column(s), then set the pgColumns of the PolyGrid?

Bob S


On Aug 24, 2023, at 1:26 PM, Paul Dupuis via use-livecode 
<use-livecode@lists.runrev.com> wrote:

Thanks Klaus.

I may use this method rather than the overhead of clearing and setting the 
whole pgData property.

Actually, the more I think about it, neither "method" should be needed. This is 
a polygrid bug. If you set the pgColumsn to fewer column, regardless of whether there is 
left over data in pgData, only the columns in the currently set pgColumns should be seen.


On 8/24/2023 2:34 PM, Klaus major-k via use-livecode wrote:
Hi Paul,

Am 24.08.2023 um 20:30 schrieb Paul Dupuis via use-livecode 
<use-livecode@lists.runrev.com>:

Aha, I was setting pgColumns to the fewer columns and THEN pgData to the 
smaller data set to match the columns
You need to clear the pgData (set to empty) first, then set the columns, then 
set the new pgData.
Perhaps this is a documentation bug?
I had success by setting the dgColumns to EMPTY first and later to the new 
"fewer" columns:
## Button "Fewer Columns"
on mouseUp pMouseButton
   local tColA, tDataA
   local tSum
   lock screen

   ## !!
   set the pgColumns of widget "myTable" to EMPTY
  ## !!

   put "rowname" into tColA[1]["name"]
...

On 8/24/2023 2:26 PM, Paul Dupuis via use-livecode wrote:
Hi to any polygrid developers out there,

Please see bug https://quality.livecode.com/show_bug.cgi?id=24315

I have run into an issue with the latest polygrid (as of this post) where if 
you set pgColumns to a new array that reduces the number of columns in the 
grid, some old columns are not cleared, but instead are set to defaults (ie. 
the names revert to col5, col6, etc. instead of being completely removed

Any thoughts to a work-around?
Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to