If you wont to have multiple dialogs you must have more then one widget,
only solution for more dialog widget in same time to be opend is as many you dialog wont to open you have to setup that much dialogs eg. below
(i don`t suggest this, better is second solution)
<?php
$this->widget('zii.widgets.CMenu',array(
'items'=>array(
array('label'=>'TEST1', 'url'=>'#','linkOptions'=>array( 'onclick'=>'$("#dialogone").dialog("open"); return false;')
),
array('label'=>'TEST2', 'url'=>'#','linkOptions'=>array( 'onclick'=>'$("#dialogtwo").dialog("open"); return false;')
),
array('label'=>'TEST3', 'url'=>'#','linkOptions'=>array( 'onclick'=>'$("#dialogthree").dialog("open"); return false;')
),
));
?>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'dialogone',
'cssFile'=>'jquery-ui-1.8.6.custom.css', //exzample customtheme
'theme'=>'custom-theme', //exzample customtheme
'themeUrl'=>Yii::app()->request->baseUrl.'/css/ui', //exzample customtheme
'options'=>array(
'title'=>'Title1',
'autoOpen'=>false,
),
));
//your code hire
//your code hire
//your code hire
//your code hire
$this->endWidget('zii.widgets.jui.CJuiDialog');
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'dialogtwo',
'cssFile'=>'jquery-ui-1.8.6.custom.css', //exzample customtheme
'theme'=>'custom-theme', //exzample customtheme
'themeUrl'=>Yii::app()->request->baseUrl.'/css/ui', //exzample customtheme
'options'=>array(
'title'=>'Title2',
'autoOpen'=>false,
),
));
//your code hire
//your code hire
//your code hire
//your code hire
$this->endWidget('zii.widgets.jui.CJuiDialog');
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'dialogthree',
'cssFile'=>'jquery-ui-1.8.6.custom.css', //exzample customtheme
'theme'=>'custom-theme', //exzample customtheme
'themeUrl'=>Yii::app()->request->baseUrl.'/css/ui', //exzample customtheme
'options'=>array(
'title'=>'Title3',
'autoOpen'=>false,
),
));
//your code hire
//your code hire
//your code hire
//your code hire
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>
Below for me is best approach:
if you dont won
t to have many dialog , but you wanna have many dialog calls and just one dialog eg.below
<?php
$url = $this->createAbsoluteUrl('site/test');
$script = "jQuery(function($) {
jQuery('body').delegate('.getid', 'click', function(){
var ids = jQuery(this).attr('id');
jQuery.ajax({
type: 'GET',
url: '".$url."',
data: 'id='+ids,
success: function(data, textStatus, XMLHttpRequest){jQuery('#upids').html(data);}
});
});
});";
Yii::app()->clientScript->registerScript(1,$script,CClientScript::POS_END);
/*
you can use hire also
CHtml::link()
*/
echo CHtml::image(Yii::app()->request->baseUrl.'/image/arrow.png','Message 1',array('id'=>1,'class'=>'getid','onclick'=>'$("#egz").dialog("open");'));
echo CHtml::image(Yii::app()->request->baseUrl.'/image/arrow.png','Message 2',array('id'=>2,'class'=>'getid','onclick'=>'$("#egz").dialog("open");'));
echo CHtml::image(Yii::app()->request->baseUrl.'/image/arrow.png','Message 3',array('id'=>3,'class'=>'getid','onclick'=>'$("#egz").dialog("open");'));
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'egz',
'cssFile'=>'jquery-ui-1.8.6.custom.css',//exzample customtheme
'theme'=>'custom-theme',//exzample customtheme
'themeUrl'=>Yii::app()->request->baseUrl.'/css/ui',//exzample customtheme
'options'=>array(
'title'=>'example',
'autoOpen'=>false,
),
));
echo '<div id="upids"></div>';
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>
all examples tested and works