DeRyl
|
| Posted: 10/28/2004, 1:25 AM |
|
hi,
I have two grids
[branza]
[klient]
in before_show client I'll try to get values from the first record of branza and klient using:
function klient_BeforeShow()
{
$klient_BeforeShow = true;
//End klient_BeforeShow
//Custom Code @305-0685DF74
// -------------------------
global $klient;
global $branza;
global $lblTLBI;
if ($klient->ds->RecordsCount == 0) {
$klient->Visible = False;
}
if ($klient->ds->AbsolutePage>50) {
$klient->ds->AbsolutePage=50;
}
if ($klient->ds->AbsolutePage>1) {
$rp = $klient->ds->PageSize * ($klient->ds->AbsolutePage-1);
}
else {
$rp = 0;
}
$ik = $klient->ds->klientid->Value;
if ($klient->ds->RecordsCount <> 0) {
$klient->ds->seek($rp);
}
if ($branza->ds->RecordsCount<>1) {
$lblTLBI->Visible=false;
}
else {
$ib = $branza->branzaid->Value;
$tlbiSQL = "select grafikaurl, reklamaurl from reklama, klientreklama, branzareklama klientreklama.reklamaid = reklama.reklamaid AND branzareklama.reklamaid = reklama.reklamaid AND branzareklama.branzaid =" . $ib;
$lblTLBI->Value= $ib . " id " . $ik;
}
// Write your own code here.
// -------------------------
//End Custom Code
//Close klient_BeforeShow @256-F38AF7F7
return $klient_BeforeShow;
}
//End Close klient_BeforeShow
but see no data - the $ib and $ik are empty - why?
how to correct this?
with regards
DeRyl
|
|
|
 |
mrachow
Posts: 509
|
| Posted: 10/28/2004, 2:42 PM |
|
In the Component Reference under Examples and Techniques there is show how to build your own recordsets, execute a query (select statement for example) and how to retrieve the results.
If you would like to change the query generated by CCS this event is too late. In BeforeShow the query ist executed already.
In the same manual is also shown how to adapt Select, where, order b aso plus when to do it.
Hope this helps,
Michael
_________________
Best regards,
Michael |
 |
 |
peterr
Posts: 5971
|
| Posted: 10/28/2004, 3:47 PM |
|
Multiple grids on a page are not related and in a grid you canot retrieve value of another grid's field.
However, you can create a global variable that retrieves the value within the 1st grid, then use that global variable in the 2nd grid.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|