4 Answers
Bonjour Patrick,
I think you can use something like this
$col = array();
$col[“title”] = “Start Date”;
$col[“name”] = “Start_Date”;
$col[“width”] = “8”;
$col[“sortable”] = true; // false this column is not sortable
$col[“search”] = true; // false this column is not searchable
$col[“editable”] = true;
$col[“formatter”] = “date”;
$col[“editoptions”][“defaultValue”] = date(“m/d/Y”);
$cols[] = $col;
Thank you for your replay. I have yet done exactly that, but that does not run: after an add, I can just find a \’NULL\’ in the database, not the date. Regards Patrick
Hello,
There are 2 ways:
- Use database field default value to CURRENT_TIMESTAMP and it will save current time of insert query.
- Use on_insert callback event handler and in your callback php function, you can set this field to current date time.
For second case, you can refer this link: https://www.gridphp.com/docs/grid-events/
Your Answer