Using standard filters in CGridView custom fields

Comparing #4 with #5

Revision #5 was created by jwerner jwerner on Dec 20, 2010, 10:26:46 AM.

Modified formatting of 1st php block

Content

[...]
So we do the usual thing:

```php
<?php $this->widget('zii.widgets.grid.CGridView', array(
//.....
array(

 
    
'name'=>'switch',
 
    
'header'=>'Switch',
 
    
'type'=>'raw',
 
    
'value'=>'Mii::getSwitch($data->switch)'
 
), //..... ),
 
));
```
`Mii::getSwitch` - is my own helper witch returns `on` or `off` according to the current switch value (in the original it returns an image).
After that the user can see `on` and `off` values in the column, but he will not be able to filter columns typing `on` or `off` in the quicksearch field.
So we do the following thing in model `search()` function:
[...]