How to Enhance a CGridView

Comparing #2 with #3

Revision #3 was created by bluyell bluyell on Apr 3, 2014, 7:52:14 PM.

adding new options

Content

[...]
'class'=>'EEditableColumn' (and its extra attributes)


```php
<?php
     Yii::import('application.extensions.eeditable.*');     
 
$grid_id = 'some-grid-view';      $this->widget('zii.widgets.grid.CGridView', array(          'id'=>$grid_id,          'dataProvider'=>$dataProvider,          'columns'=>array(              array('name'=>'firstname'),              array('name'=>'example_field',                  'class'=>'EEditableColumn', 'editable_type'=>'editbox',                  'action'=>array('/some/ajaxeditcolumn'),             ),
 
        ),
 
    
),
 
array('name'=>'example_field_2',
 
'class'=>'EEditableColumn', 'editable_type'=>'select',
 
'editable_options'=>
 
array(-1=>'--select--','1'=>'Yes','0'=>'No','3'=>'maybe!'),
 
'action'=>array('/some/ajaxeditcolumn'),
 
),
 
),
 
));      ?>

```

And this is the code required at server side to handle the change value event:
[...]