Revision #5 has been created by adlersd on Dec 29, 2012, 6:35:51 PM with the memo:
fix typo in try catch
« previous (#4)
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'));
```[...]