Populate detail table

Tips submitted by PHPMaker users
Post Reply
Aimewahi
User
Posts: 27

Populate detail table

Post by Aimewahi »

Hi,
I'd like to share this exprience in V2021 with everyone.
I noticed that i had to rem "if($this->PageID == "gridcls")" in my script in order it woks.
Below my script which works in 2021.
Is it normal not to use PageID == "gridcls" in V2021 or must I replace "gridcls" by a new item?
THANKS

function Row_Rendering()
{
    // Enter your code here
//if($this->PageID == "gridcls")
//{
$grid_count = $this->GridAddRowCount;
$grid_num = $this->GridCnt;
if(isset($_GET["MatAgent"]))
{
$IDprec= ExecuteScalar("SELECT IDFicheprec FROM vinfosevalues WHERE MatAgent='".$_GET["MatAgent"]."'");
if(isset($this->RowIndex))
{
$grid_num = $this->RowIndex;
//only when we are dawing actual rows
if(($grid_count >= $grid_num) && is_int($grid_num) && ($grid_num >= 1))
{
$offseter = $grid_num - 1;
//get & set product details
$elobj=ExecuteRow("SELECT TypeObj,NumObj,LibelleObj FROM vobjsag WHERE IDFicheAgent =$IDprec limit 1 OFFSET $offseter");
$this->TypeObjAgent->CurrentValue =$elobj["TypeObj"];
$this->NumObj->CurrentValue =$elobj["NumObj"];
$this->LibelleObj->CurrentValue =$elobj["LibelleObj"];
}
}
}
}   
//}

arbei
User
Posts: 9281

Post by arbei »

You may use:

if ($this->PageID == "grid") {


Post Reply