Shared Datagrid

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: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Stewart Lynch
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 23
Joined: Sun Jul 13, 2008 7:39 pm

Shared Datagrid

Post by Stewart Lynch » Thu Aug 11, 2016 10:13 pm

Is it possible to have he same datagrid and content shared among many cards as a shared background control? If so, any suggestions would be appreciated

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Shared Datagrid

Post by dunbarx » Fri Aug 12, 2016 12:28 am

Hmmm.

Possibly tricky. DG's are already so grouped it is hard to even understand them. But one can set the backGroundBehavior of a DG to "true" by hand, and this will permit it to be shared among cards. The tricky part is to also set the sharedText of all those fields.

So try this. Make a new stack. Put a DG on the card, and set its backGroundBehavior to "true". Put something into the contents of the DG. In the stack script:

Code: Select all

on opencard
   set the dgText of group "datagrid 1" of this cd to the dgText of group "datagrid 1" of cd 1
end opencard
Now make a few new cards. You will have to tweak this, setting the column names in a similar manner, and you may discover a few more items that have to be addressed.

Craig Newman

Post Reply