Read row from datagrid and send it to substack

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

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Read row from datagrid and send it to substack

Post by bangkok » Mon Dec 09, 2013 1:51 pm

The problem of updating DG content on substack is annoying, especially with "as modal".

So here is what i do :

-main stack : query, calculation, and then I put the content i want to display in a global variable
-i open the substack as modal

Here is script I have in the substack :

Code: Select all

on preopencard
   global gContentDG
   if gContentDG is not empty and  the mode of stack "mySubStack"=5 then set the dgData  of group "myDG"   to gContentDG
end preopencard
Do you have other strategies ?

I've tried to play with "dispatch refreshList" or "send in with mesages"... but no luck. The point seems : you have to go to the card that contains the DG. So with a modal dialog... that's a problem.

Nicke
Posts: 36
Joined: Thu Nov 28, 2013 11:19 am

Re: Read row from datagrid and send it to substack

Post by Nicke » Mon Dec 09, 2013 2:30 pm

I think I will use this approach:


In my "main" stacks card "mainWindow" I added this:

Code: Select all

command updateMainGrid theLine, theDataB
   set the dgDataOfLine[theLine] of group "mainGrid" to theDataB
end updateMainGrid
and when I close my addedit substack I have theese lines:

Code: Select all

on mouseUp
   put fld "addedit_log" into theDataB["title"]
   put "1" into theDataB["ch"]
   send "updateMainGrid theLine, theDataB" to card "mainWindow" of stack "main" in 0 seconds
   close this stack
end mouseUp
This works...

Post Reply