Date fields are null

QuestionsDate fields are null
Glenn asked 2 months ago

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.

1 Answers
Abu Ghufran Staff answered 1 month ago

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.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

2 + 14 =

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?