Hello, i would ask you how to convert when I input data on the grid as typing normal but to get result as md5?
As reference the code:
$col = array();
$col[“title”] = “Pass”;
$col[“name”] = “pass”;
$col[“width”] = “32”;
$col[“align”] = “left”;
$col[“editable”] = true; // this column is editable
$col[“formatter”] = “password”;
$cols[] = $col;
Thank you!
1 Answers
Hello, I've found the solution as the below:
// Grid events
$e = array();
$e["on_insert"] = array("pass_md5", null, true);
$e["on_update"] = array("pass_md5", null, true);
$g->set_events($e);
function pass_md5($data)
{
$data["params"]["pass_field"] = md5($data["params"]["pass_field"]);
}
Thanks!
Your Answer