Changes
Title
unchanged
How to show ajax delete status in CGridView like flash messages
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
CGridView, Ajax flash message, ajax request, Delete Status
Content
changed
[...]
echo "<div class='flash-success'>Ajax - Deleted Successfully</div>";
}catch(CDbException $e){
if(!isset($_GET['ajax']))
Yii::app()->user->setFlash('error','Normal - error message');
else
echo "<div class='flash-error'>Ajax - error message</div>"; //for ajax
}
// 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'));
```[...]