KoolReport's Forum

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

Unable to pass clumn key in formatValue function table #1730

Open test opened this topic on on Nov 23, 2020 - 1 comments

test commented on Nov 23, 2020

Hi, I am using formatValue function in Table and trying to pass column key as mentioned in the
https://www.koolreport.com/docs/koolphp/table/#table-settings-format-column-value but getting fatal error that formatvalue accepts 2 parameters only <?php

Table::create(array(
    ...
    "columns"=>array(
        "amount"=>array(
            'formatValue'=>function($value, $row, $cKey)
            {
                if ($cKey === 'amount')
                    return $row["currency"]." ".number_format($value);
                else
                    return $value;
            }
        ),
    ),
    ...
));

?> Please help as i need column key in the formatValue function. I am using koolreport v 4.7.1

Sebastian Morales commented on Nov 24, 2020

If it's possible pls upgrade to KoolReport 5 to use the $cKey parameter in DataTables' column's formatValue. I think verion 4.7.1 hasn't added it yet. Cheers,

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
help needed

None