insert calendar in multimoidelform

hi,

I am still work in multimodelform, and now I want to place calendar in $model2, but I can’t place it.

this my code in model2.php




public function getMultiModelForm()

        {

            return array(

                'elements'=>array(

                     'date_birth' => array(

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

                                  'name'=>'date_birth',

                                  // additional javascript options for the date picker plugin

                                  'options'=>array(

                                  'showAnim'=>'fold',

                                  ),

                                  'htmlOptions'=>array(

                                  'style'=>'height:20px;'

                                  ),

                               ));

                        )

                   );




What I can tell you, this is not work all, the error is $this-widget (‘zii.widgets.jui.CJuiDatePicker’ is undefine,

what the right code? and also how to shape the form in model2 became gridview? I have try just insert like this and it can’t.

Sorry folk, I have resolved my own problem

just don’t know is right or not, but this my code in _form.php (hope can help some newbie like me)




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

                'model'=>$model2,

                'attribute'=>'tanggal_lahir_penanggung',

                'value'=>$model2->tanggal_lahir_penanggung,

                // additional javascript options for the date picker plugin

                'options'=>array(

                        'showAnim'=>'fold',

                        'showButtonPanel'=>true,

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

                        'changeMonth'=>true,

                        'changeYear'=>true,

                        'yearRange'=>'1950:2100',


                ),

            ));



I got this solution in this site http://www.hollowdevelopers.com/2011/01/09/cjuidatepicker-cactiveform-yii-framework/