我有一个CJUIDialog,我使用renderPartial加载另一个表单的内容。在那种形式中,有一个ajax按钮,它载入另一个表单。该窗体包含另一个Ajax按钮,我需要在对话框内加载前一个窗体。我尝试过这样做。但它不起作用。 在我的控制器中,我有两种方法打印出这样的两种形式。在CJUIDialog中使用Ajax
public function actionNewRecipients(){
$customer = new Customer;
$address = new Address;
$content = $this->renderPartial('_form_new',array('customer'=>$customer,'address'=>$address,'guest'=>true),true);
echo $content;
}
public function actionAddRecipients()
{ $content = $this->renderPartial('_form_inner',array(),true);
echo $content;}
然后在一个形式,我有ajax的按钮一样,
echo CHtml::ajaxSubmitButton(Yii::t('New','New Recipient'),CHtml::normalizeUrl(array('customer/newRecipients')),array('success'=>'js: function(data) {
alert("new");
$("#dialog_gift").html(data);
$("#dialog_gift").dialog("option","title","Select Recipient");
}'));
,并在其他形式的,我有ajax的按钮一样,
echo CHtml::ajaxSubmitButton(Yii::t('New','New Recipient'),CHtml::normalizeUrl(array('customer/addRecipients')),array('success'=>'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')).'")
}'));
而且CJUIDialog样子,
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'dialog_gift',
// additional javascript options for the dialog plugin
'options'=>array(
'title'=>$title,
'autoOpen'=>false,
'modal'=>true,
'scrolling'=>'no',
'resizable'=>false,
'scrollable'=>false,
'closeOnEscape' => true,
),
));
echo '
echo $content;
echo '
$this->endWidget('zii.widgets.jui.CJuiDialog');
Ill be最初加载一个表单内容。
第一次转换正常发生。但是,在我替换html内容后,第二次加载其他视图的过渡不会发生。
请让我知道是否有人可以帮忙。
感谢
2012-06-29
era