Difference between #4 and #5 of
How to show ajax delete status in CGridView like flash messages

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'));
```
[...]
17 0
30 followers
Viewed: 56 828 times
Version: 1.1
Category: How-tos
Written by: hasanavi
Last updated by: adlersd
Created on: Jun 8, 2011
Last updated: 11 years ago
Update Article

Revisions

View all history