Hi
I need to add leading 00 to anythig added to a grid.
In the insert funtion I have
$data["params"]["FundCode"] = substr('00'.$data["params"]["FundCode"],-2);
but it is not working.
1 Answers
Possible reasons:
– The FundCode case must match the $col["name"]
– The leading zero code logic can be verified by debugging $data at end of function
– If you pass last argument as true, functions will act as a data filter, and insert/update will be performed by grid. e.g.
$e["on_insert"] = array("add_client", null, true);
You can put following code inside event handler to see $data content.
ob_start();
print_r($data);
$str = ob_get_clean();
phpgrid_error($str);
Your Answer