How can i call a php function to display data?
The query return me some values, if the value is 20 there is a specific text to display
Example (this is my function outside the datagrid)
function Role($p, $printPunteggio = false)
{
if ($p['por'] == 20)
{
$s .= 'P';
return $s;
}
if ($p['lib'] == 20)
$s .= 'L';
if ($p['dif'] == 20)
$s .= 'D';
if ($p['med'] == 20)
$s .= 'M';
if ($p['cen'] == 20)
$s .= 'C';
if ($p['tre'] == 20)
$s .= 'T';
if ($p['att'] == 20)
$s .= 'A';
$s .= ' ';
if ($p['ce'] == 20)
$s .= 'C';
if ($p['la'] == 20)
$s .= 'L';
return $s;
}
How can i implement into the datagrid?
Thanks
Pasting from docs:
For extended conditional data, you can also have callback function, that will allow you to display based on row data. For e.g.
$col["on_data_display"] = array("display_keyword","");
function display_keyword($data)
{
$kw = $data["keyword_name"];
$numKeywords = count(explode("n",$pass));
if ($numKeywords > 3)
return $numKeywords." Keywords";
else
{
$pass = str_replace("+"," ",$pass);
return $pass;
}
}