Leading 00

QuestionsLeading 00
David Mills asked 8 years ago

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
Abu Ghufran answered 8 years ago

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

5 + 20 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?