Yii:cguidialog和iframe
我正在使用Yii框架。我需要使用iframe创建对话框。如何在iframe中创建CJuidialog?如果你有一些经验,请分享 谢谢 我正在使用CjuiDialog创建播放列表 在我的布局中(播放列表按钮) 在同一页中添加对话框代码Yii:cguidialog和iframe,yii,Yii,我正在使用Yii框架。我需要使用iframe创建对话框。如何在iframe中创建CJuidialog?如果你有一些经验,请分享 谢谢 我正在使用CjuiDialog创建播放列表 在我的布局中(播放列表按钮) 在同一页中添加对话框代码 在视图文件中使用以下代码 $this->beginWidget('zii.widgets.jui.CJuiDialog',array( 'id'=>'mydialog', // additional javascript options for the
在视图文件中使用以下代码
$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
'id'=>'mydialog',
// additional javascript options for the dialog plugin
'options'=>array(
'title'=>'Dialog box 1',
'autoOpen'=>false,
),
));
echo 'dialog content here';
$this->endWidget('zii.widgets.jui.CJuiDialog');
// the link that may open the dialog
echo CHtml::link('open dialog', '#', array(
'onclick'=>'$("#mydialog").dialog("open"); return false;',
));
请添加更多信息,以便我们可以帮助您
$('#addavtoplaylist').live('click',function(){
$('#cru-frame').attr('src','".Yii::app()->createAbsoluteUrl("playlist/add",array('id'=>$this->model->av_id))."');
$('#cru-dialog').dialog('open');
return false;
});
<?php
//--------------------- begin new code --------------------------
// add the (closed) dialog for the iframe
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'cru-dialog',
'options'=>array(
'title'=>'Add To Play List',
'autoOpen'=>false,
'modal'=>true,
'width'=>550,
'height'=>300,
'close'=>'js:function(){
}',
),
));
?>
<iframe id="cru-frame" width="100%" height="100%"></iframe>
<?php
$this->endWidget();
//--------------------- end new code --------------------------
?>
$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
'id'=>'mydialog',
// additional javascript options for the dialog plugin
'options'=>array(
'title'=>'Dialog box 1',
'autoOpen'=>false,
),
));
echo 'dialog content here';
$this->endWidget('zii.widgets.jui.CJuiDialog');
// the link that may open the dialog
echo CHtml::link('open dialog', '#', array(
'onclick'=>'$("#mydialog").dialog("open"); return false;',
));