Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Ajax Inside CJUIDialog
    primarykey
    data
    text
    <p>I have a CJUIDialog where i load the content of another form using renderPartial. In that form there is an ajax button where it loads another form. That form contains another ajax button where i need to load the previous form inside the dialog itself. I have tried doing it like this. But it doesnt work. In my controller i have two methods that prints out the two forms like this.</p> <pre><code>public function actionNewRecipients(){ $customer = new Customer; $address = new Address; $content = $this-&gt;renderPartial('_form_new',array('customer'=&gt;$customer,'address'=&gt;$address,'guest'=&gt;true),true); echo $content; } public function actionAddRecipients() { $content = $this-&gt;renderPartial('_form_inner',array(),true); echo $content;} </code></pre> <p>And then in one form i have the ajax button like,</p> <pre><code> echo CHtml::ajaxSubmitButton(Yii::t('New','New Recipient'),CHtml::normalizeUrl(array('customer/newRecipients')),array('success'=&gt;'js: function(data) { alert("new"); $("#dialog_gift").html(data); $("#dialog_gift").dialog("option","title","Select Recipient"); }')); </code></pre> <p>and in the other form i have the ajax button like,</p> <pre><code>echo CHtml::ajaxSubmitButton(Yii::t('New','New Recipient'),CHtml::normalizeUrl(array('customer/addRecipients')),array('success'=&gt;'js: function(data) { alert("select"); $("#dialog_gift").html(data); $("#dialog_gift").dialog("option","title","Select Recipient"); //$("customer-form_inner").attr("action","'.CHtml::normalizeUrl(array('customer/newRecipients')).'") }')); </code></pre> <p>And the CJUIDialog looks like,</p> <pre><code>$this-&gt;beginWidget('zii.widgets.jui.CJuiDialog', array( 'id'=&gt;'dialog_gift', // additional javascript options for the dialog plugin 'options'=&gt;array( 'title'=&gt;$title, 'autoOpen'=&gt;false, 'modal'=&gt;true, 'scrolling'=&gt;'no', 'resizable'=&gt;false, 'scrollable'=&gt;false, 'closeOnEscape' =&gt; true, ), )); echo '&lt;div class="span-24"&gt;'; echo $content; echo '&lt;/div&gt;'; $this-&gt;endWidget('zii.widgets.jui.CJuiDialog'); </code></pre> <p>Ill be initially loading one forms content.</p> <p>The first transition happens properly. But after i replace the html content the second transition to load the other view does not happen. </p> <p>Please let me know if anyone can help.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    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.
    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