Hi all,
I have a small issue with a CCheckBoxColumn in a CGridView.
I created a CGridview and use a CCheckBoxColumn to select a row. I need to store in a cookie the list of row selected ( I also use pagination), so I implemented a ajax call like this :
In the controller I have
public function actionaddQuestion()
{
echo "Test OK";
}
in the view I have :
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'tblquizz-grid',
'dataProvider'=>$modelQuestion->listquestion(),
'columns'=>array(
array(
'class'=>'CCheckBoxColumn',
'id'=>"cid_".$modelQuestion->INUMQUEST,
'selectableRows' => 2,
'checkBoxHtmlOptions' => array( "ajax" =>
array("type"=>"POST",
"url"=>CController::createUrl("tblquizz/addQuestion"),
"update"=>"#section_info",
),
)
),
So when I click on the checkbox, the ajax method is call and I can read the post value.
But Afterthat the checkbox is not checked. If I click again, I call again the ajax method but checkbox still not checked.
So please tell me in that case how I can have the checkbox checked. Should we implement in a different way ?