Revision #3 has been created by hasanavi on Jun 9, 2011, 7:52:51 AM with the memo:
sort the spelling mistake
« previous (#2) next (#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
[...]
when you click the delete button at first it performs the delete operation in the controller then it refreshes the grid using another request. 'afterAjaxUpdate' fires just after refreshing so you can't see any message just after the first delete operation.
Now I'll show you how you can achieve this functionality.
The main tricks lieays under CButtonColumn properties. There is a property called afterDelete which will fire a function just after the deleting operation. We will use ajax polling request to display the deletion status. So, In the controller file just echo the message with your flash message css display style and for non ajax request set the Flash message using setFlash().
```php
try{
$this->loadModel($id)->delete();[...]