|
Home > Archive > Programming with dBASE > December 2006 > Navigation of a master and several children
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Navigation of a master and several children
|
|
| Glenn Johansen 2006-12-05, 7:13 pm |
| Here is the setup.
I have four queries.
1. customer
2. customer invoices
3. customer payments
4. customer orders
the rowsets in queries 2,3 and 4 have the masterrowset property set to query
#1 rowset.
I have 3 grids. Each grid displays the data from query's 2,3, and 4.
So if the customer rowset (#1) moves all three grids show the proper child
data.
----------------------------------
My question.
Is there a way to detect "FROM THE CHILDS PERSPECTIVE"
that the master row moved. I basically want an event to fire for each grid,
each time the grid is
updated with new child data ( meening the master row has been moved )
Something like, onmasterrowset_navig
ate
This event would be part of the child rowset.
--
Glenn Johansen
Software Architects, Inc.
(864) 963-8402
| |
| Ken Mayer [dBVIPS] 2006-12-05, 7:13 pm |
| Glenn Johansen wrote:
> Here is the setup.
>
> I have four queries.
>
> 1. customer
> 2. customer invoices
> 3. customer payments
> 4. customer orders
>
> the rowsets in queries 2,3 and 4 have the masterrowset property set to query
> #1 rowset.
>
> I have 3 grids. Each grid displays the data from query's 2,3, and 4.
>
> So if the customer rowset (#1) moves all three grids show the proper child
> data.
>
> ----------------------------------
>
> My question.
>
> Is there a way to detect "FROM THE CHILDS PERSPECTIVE"
> that the master row moved. I basically want an event to fire for each grid,
> each time the grid is
> updated with new child data ( meening the master row has been moved )
> Something like, onmasterrowset_navig
ate
> This event would be part of the child rowset.
This is off the top of my head, and not real code, but ...
When the masterRowset navigates, the child navigates as well, correct?
In the child navigation, you could:
// 'flag' variable:
bChanged = false
// if custom property doesn't exist ("U"), or
// if value doesn't match that in current master rowset
if type( "this.currentMaster" ) == "U" or ;
this.currentMaster # master-rowset-key-field-value
// set flag:
bChanged := true
// set/reset value
this.currentMaster = master-rowset-key-field-value
endif
// if it changed:
if bChanged
// do whatever code you need
endif
This may take some experimentation, and there may be a better way to do
it ...
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Glenn Johansen 2006-12-05, 7:13 pm |
| Now that is what I thought that I would do, but i'm not sure that the child
rowset navigates when the master changes.
I know the grid gets re-painted, I will have to do some testing.
Thanks Ken.
--
Glenn Johansen
Software Architects, Inc.
(864) 963-8402
"Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote in message
news:RYAykLMGHHA.1332@news-server...
> Glenn Johansen wrote:
query[color=darkred]
child[color=darkred]
grid,[color=darkred]
>
> This is off the top of my head, and not real code, but ...
>
> When the masterRowset navigates, the child navigates as well, correct?
> In the child navigation, you could:
>
> // 'flag' variable:
> bChanged = false
> // if custom property doesn't exist ("U"), or
> // if value doesn't match that in current master rowset
> if type( "this.currentMaster" ) == "U" or ;
> this.currentMaster # master-rowset-key-field-value
>
> // set flag:
> bChanged := true
> // set/reset value
> this.currentMaster = master-rowset-key-field-value
> endif
>
> // if it changed:
> if bChanged
> // do whatever code you need
> endif
>
>
> This may take some experimentation, and there may be a better way to do
> it ...
>
> Ken
>
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase
| |
| Ken Mayer [dBVIPS] 2006-12-06, 7:13 pm |
| Glenn Johansen wrote:
> Now that is what I thought that I would do, but i'm not sure that the child
> rowset navigates when the master changes.
> I know the grid gets re-painted, I will have to do some testing.
Um, the child *should* navigate, otherwise how do you see different rows?
I haven't tested this, but I can't see how it wouldn't.
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
|
|
|
|
|