CJuiDatePicker + CJuiDialog

Please Help,

It pretty easy to change standard date field that created by Gii on _form.php become CJuiDatePicker… it is available on yii-docs. But I really dont like the create link to open and hide _form.php, so i want to change it to CJuiDialog and the code appear like this.

<!-- This is CJUiDialog -->

<?php

$this->beginWidget(‘zii.widgets.jui.CJuiDialog’,

   array(   'id'=&gt;'create_dialog',


            // additional javascript options for the dialog plugin


            'options'=&gt;array(


                            'title'=&gt;'Organization',


                            'width'=&gt;'auto',


                            'autoOpen'=&gt;false,


                            ),


                    ));

$this->renderPartial(’_form1’, array(‘model’=>$model));

$this->endWidget(‘zii.widgets.jui.CJuiDialog’);

?>

and the link from this

CHtml::link(‘Add New’,’#’,array(‘class’=>‘search-button’)

to

CHtml::link(‘Add New Dialog Style’, ‘’,array(‘onclick’=>’$("#create_dialog").dialog(“open”); return false;’,))

For Saving the Data … no trouble at all but the CJuiDatePicker it doesn’t work now… i dont know why.

anybody know?

Sometime there are problems with id.

Try giving a unique id to the datepicker, it sometimes solve the problem.

Ow… I got the answer… I render the same form twice from the original link and modal style… when I remove the original, it work now… thx zaccaria…

I have the same problem like this. how do I fix this?

I have the same problem, how did u solve this?

thanks

Hey Reza. You should post your code.