Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery DatePicker Not Hiding After PopUp Close
    primarykey
    data
    text
    <p>In Yii I have a modal popup using CJuiDialog which is a wrapper for jquery's dialog. In this dialog I have a CJuiDatPicker which is a wrapper for jquery's datepicker.</p> <p>If I close the dialog and then open a new dialog a datepicker opens and stays visible. If I close the 2nd dialog, the datepicker stays open. If I open a 3rd dialog, a 2nd datepicker opens and stays open even after closing the dialog.</p> <p>How can I force the datepicker to close? Or, possibly more correctly when the dialog is opened for a 2nd or more time, how can I prevent it from opening a previous datepicker?</p> <p>Edit: Code for view listed below:</p> <pre><code>&lt;?php echo CHtml::link('Add Purchase','#', array('onClick'=&gt;'addTrans._addTrans_url="' . Yii::app()-&gt;createUrl('ortransaction/create',array('investment_id'=&gt;$model-&gt;id,'type'=&gt;OrTransaction::TYPE_BUY)) . '";{addTrans()};$("#dialogAddTrans").dialog("open");return false;'));?&gt; &lt;?php $this-&gt;beginWidget('zii.widgets.jui.CJuiDialog', array( 'id'=&gt;'dialogAddTrans', 'options'=&gt;array( 'title'=&gt;'Add Purchase', 'autoOpen'=&gt;false, 'modal'=&gt;true, ), ));?&gt; &lt;div class="divForAddTrans"&gt;&lt;/div&gt; &lt;?php $this-&gt;endWidget();?&gt; &lt;script type="text/javascript"&gt; //this is the magic that loads the form correctly function addTrans() { //public proprety var _addTrans_url; &lt;?php echo CHtml::ajax(array( 'url'=&gt;'js:addTrans._addTrans_url', 'data'=&gt;"js:$(this).serialize()", 'type'=&gt;'post', 'dataType'=&gt;'json', 'success'=&gt;"function(data) { if(data.status =='failure') { $('#dialogAddTrans div.divForAddTrans').html(data.div); //here is the trick: on submit-&gt;once again, call this function $('#dialogAddTrans div.divForAddTrans form').submit(function(){addTrans(); return false;}); }else{ $('#dialogAddTrans div.divForAddTrans').html(data.div); setTimeout(\"$('#dialogAddTrans').dialog('close')\",3000); } } ", ))?&gt;; return false; } </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload