Calendar Image Not Coming With Cjuidatepicker

Hi,

I am using CJuiDatePicker to show the calendar in my listing page and in update page in my project. It works nice to generate the calendar with image in listing page means [../admin] using CRUD, but no image is coming in update page but calendar is coming nicely. Can you please comment on this?

Here are two codes below…


LISTING PAGE [This works well]


array(

        'name' => 'enquiry_date',


        'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array(


            'model'=>$model, 


            'attribute'=>'enquiry_date', 


            'language' => 'en-GB',


            'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 


            'htmlOptions' => array(


            'id' => 'datepicker_for_due_date',


            'size' => '10',


            ),


            'defaultOptions' => array(  


                'showOn' => 'focus', 


                'dateFormat' => 'yy-mm-dd',


	    'showAnim'=>'fold',


	    'showOn' => 'button',


                'buttonImage' => Yii::app()->request->baseUrl . '/images/calendar.png',


                'buttonImageOnly' => true,


                'showOtherMonths' => true,


                'selectOtherMonths' => true,


                'changeMonth' => true,


                'changeYear' => true,


                'showButtonPanel' => true,


	    'buttonText' => Yii::t('ui', 'Select form calendar'),


            )


        ), 


        true), 


    ),

UPDATE PAGE [Calendar is nicely generating but no calendar image is coming]


$this->widget(‘zii.widgets.jui.CJuiDatePicker’, array(

    'name' => CHtml::activeName($model, 'inspection_date'),


    'value' => $model->attributes['inspection_date'],


'language' => 'en-GB',


'i18nScriptFile' => 'jquery.ui.datepicker-en.js',


'defaultOptions' => array( 


'showOn' => 'focus', 


'showAnim'=>'fold',


'dateFormat' => 'yy-mm-dd',


    'buttonImage' => Yii::app()->request->baseUrl . '/images/calendar.png',


    'buttonImageOnly' => true,


'showOn' => 'button',


    'showOtherMonths' => true,


'selectOtherMonths' => true,


'changeMonth' => true,


'changeYear' => true,


'showButtonPanel' => true,


'buttonText' => Yii::t('ui', 'Select form calendar'),


),


   ));

Thanks in advance.

Hi kapur,

What do you mean by "calendar image"? Do you mean "buttonImage"?

Hi softark,

       I am sorry it would be 'buttonImage'.

Thanks

I see.

Well, I don’t find anything strange in your code for update view …

Do you get any error or warning in your browser’s developer tool?

I found a solution.

Using this…

‘options’=>array(

	'buttonImage' => Yii::app()->request->baseUrl . '/images/calendar.png',


            'buttonImageOnly' => true,


	'showOn' => 'button',


            ...........


            ...........


            ...........


            ),

Instead of this…

‘defaultOptions’ => array(

            'buttonImage' => Yii::app()->request->baseUrl . '/images/calendar.png',


            'buttonImageOnly' => true,


            'showOn' => 'button',


            ............


            ............


            ............


            ),

and this works. But can you please tell me how to implement the cursor type pointer in the buttonImage?

Thanks