Yii Datepicker Renderpartial Ajax - 4Th Param To True But Not Working

Wenn i’m loading the view via ajax the datepicker wont work. I already set every single .js and .css file via setclientscript to false on ajaxRequest.


  Yii::app()->clientScript->scriptMap['jquery.js'] = false;

  and the other files as well....

Wenn i check the source code the datepicker input fields are registered


/*<![CDATA[*/

 jQuery(function($) {

jQuery('#date_from').datepicker({'showAnim':'fold'});

jQuery('#date_to').datepicker({'showAnim':'fold'});

...

I also set the renderPartial 4th param to true


  $this->renderPartial('my_view', array(some variables...), false, true);

I also gave evry datepicker on the page a unique ID. That helped neither.

When i reload the page everythign works fine, but via ajaxRequest the datepicker doesnt appear… thats pretty strange

EDIT: GOT THE SOLUTION:

i put at the bottom of my view:

$("#my_datepicker").removeClass("hasDatepicker");

$("#my_datepicker").datepicker("destroy");

$("#my_datepicker").datepicker();

its likely your events are registered before you load the contents