Accessing DataGrid Information from External Objects

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Accessing DataGrid Information from External Objects

Post by Gage » Fri Aug 02, 2013 3:28 am

Hello,

I have a couple of general questions about interacting with DataGrid Forms.

1.) Is it possible to call the GetDataOfIndex function from object script that is outside of a DG? How? I want the value returned to the handler outside of the DG to populate a temporary field that pops up outside of the DG.

2.) How can I reference a specific instance of an object inside a DG from object script outside of the DG?
Here, I tried the following process:
-in MouseUp handler of DG Behavior Script, passed 'the long id of the target' (stored as tField) that was clicked to a handler in a field outside of the DG
-handler in field uses 'put the text of fld pField into me' <--Here, I get an error message saying field "blah blah blah blah blah blah" (the long ID that was passed in) does not exist.


These are both optional ways of solving one problem, so only one answer is really needed, but for my education, both are appreciated! :)

Thank you in advance!

Phil E.

Klaus
Posts: 14216
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Accessing DataGrid Information from External Objects

Post by Klaus » Fri Aug 02, 2013 1:31 pm

Hi Phil,

1. yes, you can use VALUE:
...
put "getdataofindex(1," & QUOTE & "Name of column here..." & QUOTE & ")" into tGetIndex
put value(tGetIndex,grp 1) into tIndexValue
...

2. "the long ID of xxx" already contains the TYPE of the control:
long ID example -> field id 1065 of group id 1041 of card id 1002 of stack "Stack 1375446091"
so your:
...
put the text of fld pField into me
...
Should come WITHOUT -> fld:
...
put the text of pField into me
...


Best

Klaus

Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Re: Accessing DataGrid Information from External Objects

Post by Gage » Fri Aug 02, 2013 5:52 pm

Klaus,

You are immensely helpful!

Thanks so much.

Phil E.

Post Reply