Here is the ajaxLink.
CHtml::ajaxLink(CHtml::image(Yii::app()->theme->baseUrl."/images/score.png"), array("game/score"),
array(
"type"=>"post",
"data"=>array("id"=>$data["id"]),
"success"=>"js:function(data){ $('#mydialog'.html(data); $("#mydialog").dialog('open');}"
));
Here is action.
public function actionScore()
{
if(Yii::app()->request->isAjaxRequest)
{
$model= $this->loadModel($_POST['id']);
echo $this->renderPartial('manageScore', array("model"=>$model), false, true);
}
}
Here is the view which is rendered partially for ajax request as a response.
Another ajaxLink is in the view. Problem is that when the first ajax request to display dialog is sent, the another ajax request(CHtml::ajaxLink("Cancel", .....)) in the view is also sent together. I don't know why. Second ajax request is supposed to sent when click on the link. But it is sent without clicking. How do I prevent from send ajax request?
div class="gamePartTable">
<div>
<ul>
<li>
<?php echo CHtml::ajaxLink("Cancel", array('game/cancel'),
array(
'data'=>array('id'=>$model->id),
'type'=>'post',
'success'=>'js:function(data){alert(data);}'
));?>
</li>
<li>
<a href="#">Give up</a>
</li>
</ul>
</div>
</div>

Help












