Page 2 of 2

Re: Read row from datagrid and send it to substack

Posted: Mon Dec 09, 2013 1:51 pm
by bangkok
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.

Re: Read row from datagrid and send it to substack

Posted: Mon Dec 09, 2013 2:30 pm
by Nicke
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...