Skip to content
A simple Extension to Yii2 GridView to enable simple editable columns
Branch: master
Clone or download
Latest commit 5c05796 Jul 11, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
GridViewEditable.php Update GridViewEditable.php Aug 20, 2015 Update Jul 11, 2017
girdViewEditable.js Create girdViewEditable.js Aug 20, 2015
gridViewAsset.php Create gridViewAsset.php Aug 20, 2015


NOTE: This is not yet stable - BETA version

A simple Extension to Yii2 GridView to enable simple editable columns

This is not yet on composer, so in the meatime, you can download and install it manually. I suggest that you place it in project_name/common or some similar directory and change the "use" statement to point to the directory.

Demo available here:

GridViewEditable extends the standard Yii2 GridView to give very basic text editing. It does not provide dropdowns, checkboxes etc, just text fields.

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


If your GridView is using filters, GridViewEditable will get the fieldname to update from the filter field.

Alternatively, you can specify the field name in the column definition

    'contentOptions'=>['class'=>'editColumn', 'data-column'=>'caption']

Full use example:- view: use app\common\GridViewEditable;

    	'dataProvider' => $dataProvider,
	'updateUrl'=>'/controller/update/', // <= Points to an update Action (see below)
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
		    'contentOptions'=>['class'=>'editColumn', 'data-column'=>'caption']
            ['class' => 'yii\grid\ActionColumn'],

You have to define an action in your controller that receives $_POST data like this:

public function actionUpdate($id)
        $model = $this->findModel($id);

	if ($model->save()) {
	    if (Yii::$app->getRequest()->isAjax)
		    return Json::encode (['status'=> true]);
		    return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,

See for more details

Requires color-picker jquery plugin ( for color-picker editable control

You can’t perform that action at this time.