Hi Abu,
how can I to formated number or currency?
Ex.
$col = array();
$col[“title”] = “Descuento”;
$col[“name”] = “descuento”;
$col[“width”] = “10”;
$col[“align”] = “right”;
if($row[‘tipodescuento’] == ‘%’)
{
$col[“formatter”] = “number”;
$col[“formatoptions”] = array(“prefix” => ”,”suffix” => ‘%’,”thousandsSeparator” => ‘.’,”decimalSeparator” => ‘,’,”decimalPlaces” => 2);
}
else
{
$col[“formatter”] = “currency”;
$col[“formatoptions”] = array(“prefix” => “$”,”suffix” => ”,”thousandsSeparator” => “.”,”decimalSeparator” => “,”,”decimalPlaces” => 2);
}
$col[“search”] = false; // this column is not searchable
$cols[] = $col;
Thank you
Hi,
You will need JS custom column formatter here. I am sending you demo code.
https://gist.github.com/gridphp/a699e0e7c4a0496befd60f9d3a70732c
Custom formatter based on row data – Line 66-84