yii cgridview ajax request problem

Hello,

I am using CGridview to display all images (in admin) now i want to do a status update via ajax request, for example i want to change the status of the image to pending via ajax request (clicking on link), i did manage to do this via CHTML::link however this is not feasible solution, because when the user clicks on the next button to goto the next page list, this urls doest seems to be working code is below

how do we do this kind of thing in AJAX,in the CGridview ?




 <?php echo CHtml::link('Status',array('/ajax/imagestatus'), 

	 array(

                        'ajax' => array(

                        'type' => 'POST',

                        'url' => CController::createUrl('ajax/imagestatus'),

                        'update' => "#".$data->link_image_id."",

						'data'=>"sector=image&id=".$data->link_image_id,

						'beforeSend' => 'function(){

                     	 }'	 

						 ,

						'complete' => 'function(){

                  		}',

                    )   

				)	

	

	); ?>



You have to extend CGridColumn and go from there, for example:




class ImageColumn extends CGridColumn {

 public $ajaxUrl = '.......';

 public function renderDataCellContent($row, $data) 

 {

   $image = CHtml::value($data, $this->image);

   CHtml::link(CHtml::image($image), array($this->ajaxUrl));


 }


}