Hello! I’m using the grid and editing in a dialog, and using on_update to execute custom logic. I have several fields with date pickers on them. The UI functions fine, and the dates display on the form if there is an existing value in the database. However, if I change a date value and attempt to update the record, the values coming back from the form are always null. I believe this previously worked, but seems to fail after a recent update of PHP and ZF.
Here’s how I declare the column:
$col = array(
‘name’ => ‘OwnerPurchaseDate’,
‘title’ => ‘Purchase Date’,
‘editable’ => true
);
$col[“align”] = “center”;
$col[“formoptions”] = array(“rowpos” => “14”, “colpos” => “2”);
$col[“formatter”] = “date”;
$col[“formatoptions”] = array(“srcformat” => ‘Y-m-d’, “newformat” => ‘m/d/Y’);
$col[“show”] = array(“list” => false, “add” => true, “edit” => true, “view” => false);
$cols[] = $col;$e[“on_update”] = array(“onUpdate”, new MyController(), false);
But in onUpdate, the following no longer works:
public function onUpdate($data)
{
if ($data[“params”][“OwnerPurchaseDate”] != null && $data[“params”][“OwnerPurchaseDate”] != “NULL”) {// do something
}
}
Other fields with different field types work fine. It’s only the date types that are failing. I’ve confirmed that the grid is sending the entered values in the POST body, but the values for date fields are always null in onUpdate, thus my “do something” logic above never runs.
Hi,
Can you please tell which version are you using? Check the header comments of lib/inc/jqgrid_dist.php for version details.
PS: Your email address is not in our system. Kindly email us your order number or payment email address at [email protected] for priority support.