Jump to content
Larry Ullman's Book Forums

Problem In Using X-Editable Extension Of Yii


Recommended Posts

I am using this extension and it works good. but when I change the date then as it is updated in the database, but on the gridview field it is not displaying.
I am using beforeSave() and afterFind() methods of yii in my model. as bellow

protected function beforeSave() {
if (parent::beforeSave()) {
if ($this->isNewRecord) {
$this->dob= date('Y-m-d', strtotime($this->dob));
return true;
} else {
$this->dob= date('Y-m-d', strtotime($this->dob));

            return true;
        }
    } else
        return false;
}
protected function afterFind() {

if (strtotime($this->dob) != 0)
$this->dob= XHtml::formatDate($this->dob);
else
$this->dob= '';

    return TRUE;
}

So how can I solve my problem.
Also the datepicker range is from 2004-2024 is the issue that how to increase this range.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...