Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:19:38+00:00 2026-06-14T14:19:38+00:00

Problem : datepicker at filter is not working after filtering. I tried to put

  • 0

Problem : datepicker at filter is not working after filtering.

I tried to put the datepicker into filter of cgridview. It was success. but when the datepicker is not working after filtering. all of the cgridview has a same problem. How can I solve this problem?

before filter : before filter
after filter :after filter

This cgridview

<?php $this->widget('zii.widgets.grid.CGridView', array(
            'id'=>'history-grid',
            'dataProvider'=>$model->search($id),
            'filter'=>$model,
            'columns'=>array(
                array(
                    'name'=>'user_id',
                    'value'=>'$data->profiles->firstname',
                ),
                'action',
                array(
                    'name'=>'status',
                    'value'=>'$data->status',
                    'filter' => $status_list,
                ),
                array(
                    'name'=>'created_date',
                    'value'=>'date("d-M-Y h:m a",strtotime($data->created_date))',
                    'filter'=>$this->widget('zii.widgets.jui.CJuiDatePicker', array(
                        'name'=>'History[created_date]',        
                        'model'=>$model,
                        'value' =>date('d-M-Y', strtotime($model->created_date)) ,
                        'i18nScriptFile' => 'jquery.ui.datepicker-eng.js', // (#2)
                        'htmlOptions' => array(
                            'id' => 'History_created_date',
                            'size' => '10',
                        ),
                        'defaultOptions' => array(  // (#3)
                            'showOn' => 'focus', 
                            'dateFormat' => 'dd-M-yy',
                            'showOtherMonths' => true,
                            'selectOtherMonths' => true,
                            'changeMonth' => true,
                            'changeYear' => true,
                            'showButtonPanel' => true,
                            //'yearRange'=>'-1:+1', 
                            'yearRange'=> '2012:+1',
                            'minDate'=>'js:new Date(' . date('2012,m-3,1') . ')', 
                            //'defaultDate'=>'js:new Date(' . date('2012,m-11,1') . ')', 
                        )
                    ),true),    
                ),
            ),
        )); ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:19:39+00:00Added an answer on June 14, 2026 at 2:19 pm

    You need re-init datepicker after the cgridview updated. Read this: http://www.yiiframework.com/wiki/318/using-cjuidatepicker-for-cgridview-filter/

    Add add afterAjaxUpdate in CGridView init options

    'dataProvider'=>$model->search($id),
    'filter'=>$model,
    'afterAjaxUpdate' => 'reinstallDatePicker', // (#1)
    

    And define this function:

    // (#5)
    Yii::app()->clientScript->registerScript('re-install-date-picker', "
    function reinstallDatePicker(id, data) {
        $('#History_created_date').datepicker();
    }
    ");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

. Hello, I'm using jqueryui's datepicker, and it works great but there's a problem.
I am having a problem with the jQuery datepicker. My form has a add
I have jQuery Datepicker inside my form. My problem is after I have clicked
So The problem is my language works for my calendar but not for the
Okay, my problem's simple. The datepicker has lack of years in the year dropdown
I have a problem with datePicker. When a make a new text field with
I have a problem with the CSS of the datepicker, I downloaded a default
I'm having a problem trying to format the output on the jQuery UI datepicker.
Hi guys i have a problem i my code i set a datepicker with
I currently have the DatePicker in my project but there are problems due to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.