Revision #3                                    has been created by  Alex Muir                                    on Sep 23, 2009, 10:03:30 PM with the memo:
 Alex Muir                                    on Sep 23, 2009, 10:03:30 PM with the memo:
                                
                                
                                    Clarified where code should go.                                
                                                                    « previous (#2)                                                                                                    next (#4) »                                                            
                            Changes
                            
    Title
    unchanged
    How to add ajax-loading indicators
    Category
    unchanged
    Tutorials
    Yii version
    unchanged
    
    Tags
    unchanged
    
    Content
    changed
    [...]
Here's a simple (and good looking) solution for yii.
Basically we'll fade out all elements within a div to 80% opacity, while displaying a loading indicator in the background.
The advantage of this solution is, that you don't have to add extra markup to your page.
When performing the ajax request, add the .loading class to your, usually a div, element. And remove it when the request is complete. 
 
 
You should put the following code in your view file:
```php
<?php 
 echo CHtml::form();
 echo CHtml::ajaxButton ([...]