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

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

Revisions

View all history