KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Formating color #673

Open Daniel Amamoo-Otchere opened this topic on on Feb 13, 2019 - 1 comments

Daniel Amamoo-Otchere commented on Feb 13, 2019

Hello , Per your example below how do I use another field from the same query to do the color checks

Table::create(array(
    "dataSource"=>$this->dataStore('data'),
    "columns"=>array(
        "name",
        "age",
        "income"=>array(
            "formatValue"=>function($value,$row)
            {
                $color = $value>70000?"#718c00":"#e83e8c";
                return "<span style='color:$color'>$".number_format($value)."</span>";
            }    
        )
    ),
));
KoolReport commented on Feb 13, 2019

You use $row["another_column_name"]

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None