Wizardbehavior + Cjuidatepicker?

I am using WizardBehaviour and in step 3 I have some date fields.

I define the form fields for each step inside the MyWizardModel as an array.


... 

// for step 3

  return array(

    'title'=>'Step - 3',

    'showErrorSummary'=>true,

    'elements'=>array(

      'startDate'=>array(

 	//'visible'=> true,

	//'onfocus'=>'alert("select"); $("#ContractWizard_startDate").datepicker();',

 	//'tooltip'=>Yii::app()->locale->getDateFormat('short'),

 	//'class'=>'zii.widgets.jui.CJuiDatePicker',

 	'hint'=>'Format expected ('.Yii::app()->locale->getDateFormat('short').')'

   ),

   'endDate'=>array(

 	'hint'=>'Format expected ('.Yii::app()->locale->getDateFormat('short').')'

	),

  'buttons'=>array(

	'cancel'=>array( 'type'=>'submit', 'label'=>'Cancel' ),

	'submit'=>array( 'type'=>'submit', 'label'=>'Next' ),

  )

);



In the controller I retrieve the config for the form step, populate any values that are missing, and pass it to the view.

In my view I use:


echo CHtml::tag( 'div', array('class'=>'form'), $form );

Is there a ‘clean’ way to link the field definition (in the model array) to CJuiDatePicker ?

[color="#006400"]/* Moved to Extensions */[/color]

getting closer…

http://www.yiiframework.com/forum/index.php/topic/22103-cforminputelement-and-cjuidatepicker-config/

but this doesn’t work for me. I don’t get any errors, but the datepopup does not trigger.

I solved it finally. I’d put in a load of extra stuff before I found the link above. Now that I’ve removed all the unwanted code and reduced the functionality it works nicely.

I got same issue, and it solved under KonApaz’s help. If you want to see my code, use below link to the post:

http://www.yiiframework.com/forum/index.php/topic/44535-add-datepicker-in-cform/page__p__210951#entry210951