Hello Yiiers,
I believe it is something about AjaxLink and the cache mechanism or ERememberFiltersBehavior usage but I am not sure. I have tried to find something related in the forum but no success.
I have coded a column with AjaxLink to show a CJuiDialog popup that shows more details about that column.
At the first renderization time, everything is Ok. The AjaxLink shows the current description (1st param) and its associated link (2nd param) runs fine, passing the right column value ($data->numprotocolo) to controller/action.
But whenever I change some filter in that grid, bringing new results, AjaxLink/CGridView insists in passing the value from the old row (before applying some filter) although the new description is shown correctly.
Pressing browser refresh key helps to get the correct value.
Any directions? Please help!
(Using Yii 1.1.13)
In the view:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'mygrid',
'dataProvider'=>$model->search(),
'filter'=>$model,
:::::::
'columns'=>array(
:::::::
array(
'name'=>'numprotocolo',
'type'=>'raw',
'value'=>'CHtml::ajaxLink(
$data->numprotocolo,
array("contrato/recuperaProtocolo","numprotocolo"=>$data->numprotocolo),
array(
"success"=> "
function(data){
$(\'#popupContent\').html(data);
$(\'#showProtocolo\').dialog(\'open\');
return false;
} ",
))',
::::::
),
::::::
));
In the controller:
public function actionRecuperaProtocolo($numprotocolo)
{
echo Contrato::model()->recuperaProtocolo($numprotocolo);
Yii::app()->end();
}