The CHtml::ajaxLink
method has the following signature: ajaxLink(string $text, mixed $url, array $ajaxOptions=array ( ), array $htmlOptions=array ( ))
The onclick
event you're trying to bind to in this case is an HtmlOption and not an Ajax option hence, you need to specify it as such.
When you specify the onclick
event to display your dialog, you also need to remove the return false;
statement as this would prevent the ajaxCall from being made.
So your definition should look like this:
$url = CHtml::ajaxLink(
Yii::t('job', 'Ledig'),
Yii::app()->createUrl('leads/admin'),
array('update' => '#offerDialog'),
array('id' => 'showOfferDialog', 'onclick' => '$("#offerDialog").dialog("open");')
);
//Show Link
echo $url;
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id'=>'offerDialog',
// 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');