Reputation: 584
i used dialogbox in yii I want to change postinion to near link dialog how can it?
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'mydialog',
'options'=>array(
'title'=>'Dialogg',
'width'=>200,
'height'=>100,
'autoOpen'=>false,
),
));
echo 'dialog content here';
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>
<?php echo CHtml::link(Yii::t('ui','Dialogooooooooo'), '#', array('onclick'=>'$("#mydialog").dialog("open"); return false;')); ?>
Upvotes: 1
Views: 1073
Reputation: 2361
Updated:
You can try this to change the position of your dialog:
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'mydialog',
'options'=>array(
....
'position'=>array('my'=>'bottom','at'=>'bottom', 'of' => '#targetLink),
// or 'position'=>array(x, y),
....
),
));
.....
<?php echo CHtml::link(Yii::t('ui','Dialogooooooooo'), '#', array('id' => 'targetLink', 'onclick'=>'$("#mydialog").dialog("open"); return false;')); ?>
You can see this link http://api.jqueryui.com/position/ to know what 'my', 'at' and 'of' are working. BTW, I updated my example: specify value for 'of' option
and id
for the link
.
More info: http://api.jqueryui.com/dialog/#option-position
Upvotes: 2