How to compare field in Row Rendered event?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
pelurusilver
User
Posts: 45

How to compare field in Row Rendered event?

Post by pelurusilver »

I would like to compare 2 field and coloring the backgroun of the 2nd field if the figure is not the same.
there is no error upon viewing, but the color also not appear even the both comparison field differ.
what I am doing wrong;

// Row Rendered event
function Row_Rendered() {

    $jumlahPinjamanValue = $this->{'JUMLAH PINJAMAN'}->CurrentValue;
    $amountApprovedValue = $this->{'AMOUNT_APPROVED'}->CurrentValue;

    if ($jumlahPinjamanValue > $amountApprovedValue) {
        $this->{'JUMLAH PINJAMAN'}->CellAttrs["style"] = "background-color: #FD7F7F; color: black;"; 
    } elseif ($jumlahPinjamanValue < $amountApprovedValue) {
        $this->{'JUMLAH PINJAMAN'}->CellAttrs["style"] = "background-color: #00FF00; color: black;";  
        $this->{'JUMLAH PINJAMAN'}->CellAttrs["style"] = "background-color: #FFFFFF; color: black;";  
    }

}

arbei
User
Posts: 9384

Post by arbei »

There is no $this->{'FOO BAR'}, to check field variable names, see Database, Table and Field Variable Names.


Post Reply