title: EJuiDateTimePicker/CJuiDateTimePicker not working inside a CJuiDialog
body: <p>This seemed to be asked before but applying such answers did not gave me the solution.  I have a create form which records the payments of the clients. It works just fine until I tried to transfer it inside a CJuiDialog in another view.
  In my create.php:</p>
  
  <pre><code>&lt;?php
      /* @var $this PaymentsController */
      /* @var $model Payments */
  
      $this-&gt;breadcrumbs=array(
          'Payments'=&gt;array('index'),
          'Create',
      );
  
      $this-&gt;menu=array(
          array('label'=&gt;'List Payments', 'url'=&gt;array('index')),
          array('label'=&gt;'Manage Payments', 'url'=&gt;array('admin')),
      );
  
   ?&gt;
  
  &lt;h4 class="text-success"&gt;Payments &lt;span class="glyphicon glyphicon-tag"&gt;&lt;/span&gt;&lt;/h4&gt;
  &lt;hr&gt;
  &lt;?php $this-&gt;renderPartial('_form', array('model'=&gt;$model)); ?&gt;
  </code></pre>
  
  <p>And this is how i put the datetimepicker in my _form.php:</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'payment_date'); ?&gt;
      &lt;?php 
  
          $this-&gt;widget('EJuiDateTimePicker',array(
              'model'=&gt;$model, //Model object
              'attribute'=&gt;'payment_date', //attribute name
              //'dateFormat'=&gt;'dd-mm-yy',
              'value'=&gt;date('MM-dd-yy H:i:s'),
              'mode'=&gt;'datetime', //use "time","date" or "datetime" (default)
              'language'=&gt;'en-GB',
              'options'=&gt;array(
  
              'dateFormat'=&gt;'yy-mm-dd',
               ) // jquery plugin options
              ));
      ?&gt;      
      &lt;?php echo $form-&gt;error($model,'payment_date'); ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and in my actionCreate controller:</p>
  
  <pre><code>public function actionCreate($id, $bal)
  {
      $model=new Payments;
      $model-&gt;contract_id = $id;
      // Uncomment the following line if AJAX validation is needed
       $this-&gt;performAjaxValidation($model);
  
      if(isset($_POST['Payments']))
      {
  
          $_POST['Payments']['remaining_balance'] = $bal - $_POST['Payments']['down_payment'];
          $_POST['Payments']['paid_thru'] = $_POST['Payments']['account_id'];
          $balance = $_POST['Payments']['remaining_balance'];
          $model-&gt;attributes=$_POST['Payments'];
          if($model-&gt;save())
              {
                  $model-&gt;updateBalance($id, $balance);
                  $this-&gt;redirect(array('servicecontract/view','id'=&gt;$id));
              }
      }
  
      $this-&gt;renderPartial('create',array(
          'model'=&gt;$model, 'contr'=&gt;$id,
      ),false, true);
  }
  </code></pre>
  
  <p>and this is how I implement the CJuiDialog in my view.php:</p>
  
  <pre><code>        &lt;?php
          echo CHtml::ajaxLink(
          "Make Payments", //link label
          Yii::app()-&gt;createUrl( 'tcfunecareModule/payments/create'),
          array( // ajaxOptions
              'type' =&gt; 'GET',
              'success' =&gt; "function( data )
                  {
                      //alert( data );
                      $('#mydialog').dialog('open');
                      $('#dlg-content').html(data);
                  }",
              'data' =&gt; array( 'id' =&gt; $model-&gt;contract_id, 'bal'=&gt;$model-&gt;contract_balance)
          ),
          array('class'=&gt;'btn btn-info pull-right')
          );
      ?&gt;
          &lt;?php $this-&gt;beginWidget('zii.widgets.jui.CJuiDialog', array(
          'id' =&gt; "mydialog",
          'options' =&gt; array(
          'autoOpen' =&gt; false,
          'width' =&gt; 'auto',
          'height' =&gt; 'auto',
          //'show'=&gt;'fade-in',
          'hide'=&gt;'fade',
          'modal' =&gt; true,
          'open'=&gt; 'js:function(event, ui) { $(".ui-dialog-titlebar").hide(); }',
          'buttons' =&gt; array(
                  Yii::t('app', 'Close') =&gt; 'js:function() {$(this).dialog("close");}',
          ),
          )));
       ?&gt;
          &lt;div id="dlg-content" style="dispay:none;"&gt;&lt;/div&gt;
       &lt;?php 
          $this-&gt;endWidget('zii.widgets.jui.CJuiDialog');
       ?&gt;
  </code></pre>
  
  <p>The EJuiDateTimePicker works fine when create.php is being run in an entire page. But when I render it inside the CJuiDialog, it is not working. What should I do?</p>