Editable Column

Inline editing of tabular data

This is the EditableColumn widget from Vitaliy Potapov.

Using this widget you can make editable one column of CGridView.

Let's pretend we have a table of the various regions from all over the world, and we want to be able to rename any of them.

Displaying 71-80 of 3940 results.
Country code Name
USVermont
USWashington
USWest Virginia
USWisconsin
USWyoming
ADCanillo
ADEncamp
ADLa Massana
ADOrdino
ADSant Julia de Loria
$this->widget(
    'booster.widgets.TbGridView',
    array(
        'type' => 'striped bordered',
        'dataProvider' => new CActiveDataProvider('Region'),
        'columns' => array(
            'country_code',
            array(
                'class' => 'booster.widgets.TbEditableColumn',
                'name' => 'name',
                'sortable' => false,
                'editable' => array(
                    'url' => $this->owner->createUrl('example/editable'),
                    'placement' => 'right',
                    'inputclass' => 'span3'
                )
            )
        ),
    )
);

There's only one specific property:

Property Description
array editable = array() This is the configuration for editable widget inside this column. It is identical to the config for TbEditableField.

You can look at the other options at the Yii documentation for CDataColumn.