in a view i have
<div class="panel" id="explorer_handler"></div>
echo CHtml::ajaxLink(
'Test request', // the link body (it will NOT be HTML-encoded.)
array('/site/explorer'), // the URL for the AJAX request. If empty, it is assumed to be the current URL.
array(
'update'=>'#explorer_handler'
)
);
in that controller
public function actionExplorer()
{
$this->renderPartial('explorer',array());
}
in explorer view i have the above links
<div class="panel" id="student_panel_handler">
<?php .
.
.
.
.
$this->renderPartial('student_panel',array('model'=>$model,
'list'=>$posts,
)) ;
?>
</div>
and in student_panel view
if(isset($_REQUEST['name']) and $_REQUEST['name']!=NULL)
{
echo CHtml::ajaxLink("name", Yii::app()->createUrl('/site/manage' ), array('type' =>'GET','data' =>array( 'name' => $name,'admissionnumber'=>'','Students[batch_id]'=>$bat ),'dataType' => 'text', 'update' =>'#student_panel_handler',array()));
}
if(isset($_REQUEST['admissionnumber']) and $_REQUEST['admissionnumber']!=NULL)
{
echo CHtml::ajaxLink("add.No", Yii::app()->createUrl('/site/manage' ), array('type' =>'GET','data' =>array( 'name' => $name,'admissionnumber'=>'','Students[batch_id]'=>$bat ),'dataType' => 'text', 'update' =>'#student_panel_handler',array()));
}
if(isset($_REQUEST['Students']['batch_id']) and $_REQUEST['Students']['batch_id']!=NULL)
{
echo CHtml::ajaxLink("Batch", Yii::app()->createUrl('/site/manage' ), array('type' =>'GET','data' =>array( 'name' => $name,'admissionnumber'=>'','Students[batch_id]'=>$bat ),'dataType' => 'text', 'update' =>'#student_panel_handler',array()));
}
<?php echo CHtml::ajaxLink('A', Yii::app()->createUrl('/site/manage' ),array('data' =>array('name' =>$name,'admissionnumber'=>$ad,'Students[batch_id]'=>$bat, 'val' => 'A'),'dataType' => 'text','update'=>'#student_panel_handler'),array());
<?php echo CHtml::ajaxLink('B', Yii::app()->createUrl('/site/manage' ),array('data' =>array('name' =>$name,'admissionnumber'=>$ad,'Students[batch_id]'=>$bat, 'val' => 'B'),'dataType' => 'text','update'=>'#student_panel_handler'),array());
<?php echo CHtml::ajaxLink('C', Yii::app()->createUrl('/site/manage' ),array('data' =>array('name' =>$name,'admissionnumber'=>$ad,'Students[batch_id]'=>$bat, 'val' => 'C'),'dataType' => 'text','update'=>'#student_panel_handler'),array());
<?php echo CHtml::ajaxLink('D', Yii::app()->createUrl('/site/manage' ),array('data' =>array('name' =>$name,'admissionnumber'=>$ad,'Students[batch_id]'=>$bat, 'val' => 'C'),'dataType' => 'text','update'=>'#student_panel_handler'),array());
and in thats action
public function actionManage()
{
.
.
.
.
.
$this->renderPartial('student_panel',array('model'=>$model,
'list'=>$posts,
)) ;
}