Hi there,
I have a CGridView with AJAX mode enabled. One of the columns is a check-box that performs an AJAX request, archiving\getting an article out of the archive.
I should have thought of it beforehand, but when a user goes to the second page, sorts or searches items, "data" => "event=" . $data->event_id will stay the same for a row whatsoever, meaning it will always send requests as though a user were working with the unchanged data.
I will be really grateful if anyone can give me a hint on this one.
array(
'name' => 'is_archived',
'filter'=>'',
'header'=>'Arhive',
'type' => 'raw',
'value' => 'CHtml::checkBox("archive_event",
$data->is_archived,
array(
"return" => true,
"ajax" => array(
"type" => "POST",
"url" => Yii::app()->createUrl("admin/event/archive"),
"data" => "event=" . $data->event_id,
"success" => "function(data){
$(\"#Notification\").jnotifyAddMessage({
text: data,
permanent: false
});
}
",
)
)
)', ),