Renderpartial Effects On Widgets

Hi, I am trying to make a report that adds a followUp to a project. I can succesfully do this with addComments and addNotes and it works fine, but those are just text. I need a jcuidatepicker to pick a date for followUp. When I render Partial, it appears, but does not function; if I click, not datepicker comes up. If I render instead of renderPartial it appears to work, but I dont want a complete render, I want to be able to do stuff without leaving page and without rendering the full page like it does. So, the jquery seems to not be working with renderPartial, or maybe I am doing something wrong, but the others work fine and are done in the same fashion.

Thanks, Jonathan

 <?php echo "   ";

 echo CHtml::ajaxButton('Add Followup',

Yii::app()->createUrl('followUp/addFollowUp',array("id" => $model->id,)),


'dataType' => 'html',

'type' => 'post',

'update' => '#follow-up'

) // ajax

); // script


public function actionAddFollowUp($id)




		$model=new FollowUp;





			//$project->project_id = $id;

			//$model->user_id = yii::app()->session['userID'];


			if($model->save()) {






		$this->renderPartial('create', array ('model'=>$model,false,true));




Here is the actual form


/* @var $this FollowUpController */

/* @var $model FollowUp */

/* @var $form CActiveForm */




<div class="form">


<?php $form=$this->beginWidget('CActiveForm', array(



		'clientOptions' => array(

				'validateOnSubmit' => true,

				'validateOnChange' => true,)

)); ?>

	<div id="row"><?php echo $form->labelEx($model,'date'); ?>




		'value' => $model->date,

	   	'model'=> $model,




		'cssFile'=>array('jquery-ui.css' ),

			'options' => array(







			        'defaultDate' => 'date',




                 'onsubmit'=>"return false;", 







			border: 1px solid #A80;

			padding-left: 4px;'




	?><?php echo $form->error($model,'date'); ?>


     	<div id="note"><?php echo $form->labelEx($model,'note'); ?>

     	<?php echo $form->textArea($model,'note',array( 'rows' => 2, 'cols' =>20, 'maxlength'=>256)); ?>

		<?php echo $form->error($model,'note'); ?>



		<?php  echo CHtml::button('Back',array('onclick'=>'js:history.go(+1);returnFalse;','style'=>'font-size: 14px;font-weight: bold;')); ?>

	 	<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?> 




<?php $this->endWidget(); ?>


The widget register some javascript. That js is rendered when using render(), not when using renderPartial.

Maybe, you can add the add the script in your partial template using CClientScript.render() or renderBodyEnd (you have to find where is the js rendered in CJuiDatePicker code)

Another solution could be to copy the rendered js code, change it to bind js code to a class a not an id, then include it the view (the first one, not the partial).

That’s how i would try to solve that prob …

Hope it can help…