We are going to deploy the new yiiframework.com website on March 23, 2018 from 8:00 to 12:00 UTC.
Website and Yii documentation will not be available in this time frame. Check the news for more details.

Yii 1.1: editablegridview

extension to make rows of anCGridView editable




  • Yii 1.1 or above


Extract both Classes to application/extensions/

CEditableGridView represents a grid view which contains editable rows and an optional 'Quickbar' which fires an action that quickly adds entries to the table.

When you assign an Column an relation-field (for example 'post.author') this Widget automatically renders an Drop-Down Field to choose between the available actions. To achieve this, the Relation-Widget is used (it is contained in the release) (since 0.2)

To make a Column editable you have to assign it to the class 'CEditableColumn'

Use it like the CGridView:

$this->widget('zii.widgets.grid.CEditableGridView', array(
     'quickCreateAction'=>'QuickCreate', // will be actionQuickCreate()
           'title',          // display the 'title' attribute
            array('header' => 'editMe', 'name' => 'editable_row', 'class' => 'CEditableColumn')

With this Config, the column "editable_row" gets rendered with inputfields. The Table-header will be called "editMe".

You have to define a action that receives $_POST data like this:

public function actionQuickCreate() {
     $model=new Model;
        $this->redirect(array('admin')); //<-- assuming the Grid was used unter view admin/

Note: When using the newest "filter"-technique of Yii the automatic relation resolvment fails; so be sure to comment out the 'filter' => $model, generated by the yiic crud command.

Still todo

  • make inputs writeable by JavaScript

  • make Drop-Down-List filterable by a criteria (will be in 0.3 soon)

Change Log

January 26, 2010

  • The Widget now renders an automatic DropDownList when
  • an relation field (for example post.author) occurs

January 19, 2010

  • Initial release.

Total 12 comments

#12170 report it
hiral darji at 2013/03/04 05:17am
Update through CEditableGridView

i want to display textbox in and dropdownlist in CEditableGridView , i want to update perticular record dont want to create.

anybody cna help me?

#10769 report it
fleuryc at 2012/11/22 08:47am
links are broken


I'd like to try the demo, but it seems the links at the top :

  • Home page
  • Try out a demo
  • Join discussion
  • Report a bug

are broken...

Where can I see a demo? (And maybe fix those links while you're here...)


#9818 report it
lvsan at 2012/09/12 11:43pm
how to reload grid after quickcreate???

hi, how can i reload the gridview after quickcreate. my form have 2 models and i just would like to reload the child grid after create aand the parent still in update form.


#9769 report it
JMNorris at 2012/09/09 02:20pm
Reply to #3983

nadeem #3983 ran into the error: Alias "zii.widgets.grid.CEditableGridView" is invalid. This is a documentation problem. The documentation's example was:

$this->widget('zii.widgets.grid.CEditableGridView', array(
     'quickCreateAction'=>'QuickCreate', // will be actionQuickCreate()
           'title',          // display the 'title' attribute
            array('header' => 'editMe', 'name' => 'editable_row', 'class' => 'CEditableColumn')

If you followed the installation instructions and put the class file in the extensions directory, the this should be:

$this->widget('ext.CEditableGridView', array(
     'quickCreateAction'=>'QuickCreate', // will be actionQuickCreate()
           'title',          // display the 'title' attribute
            array('header' => 'editMe', 'name' => 'editable_row', 'class' => 'ext.CEditableColumn')

I instead created an editableGrid subdirectory (of the extensions directory) for the class files. This requires changing the example code to:

$this->widget('ext.editableGrid.CEditableGridView', array(
     'quickCreateAction'=>'QuickCreate', // will be actionQuickCreate()
           'title',          // display the 'title' attribute
            array('header' => 'editMe', 'name' => 'editable_row', 'class' => 'ext.editableGrid.CEditableColumn')

Now I to need to figure out to get it to save the edited cell.

#7769 report it
Th3 R00ST3R at 2012/04/17 02:10pm
Saving the edited data?

I have seen a few comments on saving the edited data to the database, but don't see an answer. When I hit save on the main record, the value in the updated edited column of the grid does not save..

How do you save the data in the CEditableColumn?


$this->widget('zii.widgets.grid.CEditableGridView', array(
 'quickCreateAction'=>'QuickCreate', // will be actionQuickCreate()
       array('header' => 'ratingid', 'name' => 'ratingid', 'class' => 'CEditableColumn'),


public function actionQuickCreate() {
     $model=new PerfReviewSub;
        $this->redirect(array('update')); //<-- assuming the Grid was used unter view admin/
#3983 report it
nadeem at 2011/05/25 03:34am
can you tell me how to use

hello getting this error

Alias "zii.widgets.grid.CEditableGridView" is invalid. Make sure it points to an existing PHP file i extracted file under the extension folder

$this->widget('zii.widgets.grid.CEditableGridView', array( 'dataProvider'=>$dataProvider, 'showQuickBar'=>'true', 'quickCreateAction'=>'QuickCreate', // will be actionQuickCreate() 'columns'=>array( 'Source', // display the 'title' attribute array('header' => 'editMe', 'name' => 'editable_row', 'class' => 'CEditableColumn') ),));

#3632 report it
thyseus at 2011/04/25 01:13pm

unfortunately i do not have a project that needs a "updated" version of the CEditableGridView yet - altough i already have a lot of ideas on what could be made better.

For example, after -ing out of a column it could get green after a successfull ajax request that saved the column, yellow with a validation error message if it fails, and red if another error occurs. As soon as i need this funtionality in one of my projects i definitely will make it modular and release it under this extension.

If you want you could start something like that - any help is appreciated of course ;)

good to know that someone still looks at this extension even if it is >1 year old ;)

#3625 report it
sltech at 2011/04/25 06:55am
looking for code to post the changed rows

hi, is there any new updates on this, would appreciate the help if could post the code to update the editable rows

great work!!


#2479 report it
Peter JK at 2011/01/07 08:25am
How the QuickCreate Action Work?

Can you explain how the QuickCreate Action Work? I dont see a submit button there to process the changes/input on editable_row.

#2388 report it
Stefanus at 2010/12/22 12:25am
Is there another editable field control ?

Hi.. This is what I'm looking for, good Job. But if I want a different editable field , for examle like dropdown or check box ?

Is there any suggesstion ? or something tutorial /example ?

Thanks a lot


#248 report it
schlydi at 2010/07/28 03:45am
works for me!!

After I made some adjustments I now can update the editable fields, still need something to delete the model..

#639 report it
donnut at 2010/04/02 09:10am

I wonder what the use of the editable fields are? They are not posted in the current implementation (v 0.2), only the QuickBar gets posted.

Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: thyseus
  • Category: User Interface
  • Votes: +4 / -4
  • Downloaded: 6,100 times
  • Created on: Jan 19, 2010
  • Last updated: Jan 26, 2010