When I delete records from CGridView, I just change a "flag" from 0 to 1.
public function actionDelete($id)
{
$model=$this->loadModel($id);
$model->flag=1;
$model->save();
// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
if(!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
}
In every table I have a field "comments", and I would like to update this field when "deleting".
Eg. when user deletes a record from CGridView, not only the flag is changed from 0 to 1,
but I want to display (maybe in a popup) just the "comments" field so he/she can write why was this record "deleted".
As much as my understanding, you have to overwrite the delete functionality. May replace the default delete button with the custom one, popup comment box and pass the comments with the id to the delete action that you already modified.