PHPackages                             dacduong/yii2-inlinegrid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dacduong/yii2-inlinegrid

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

dacduong/yii2-inlinegrid
========================

Inline Gridview for editing content like in Excel

1.0.0(9y ago)133.6k2BSD-3-ClausePHP

Since Mar 24Pushed 9y ago2 watchersCompare

[ Source](https://github.com/dacduong/yii2-inlinegrid)[ Packagist](https://packagist.org/packages/dacduong/yii2-inlinegrid)[ Docs](https://github.com/dacduong/yii2-inlinegrid)[ RSS](/packages/dacduong-yii2-inlinegrid/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Inline Gridview
===============

[](#inline-gridview)

Yii2 Inline Gridview for editing content like in Excel

[![Inline GridView](./docs/alwaysEdit.png)](./docs/alwaysEdit.png)

[![Inline GridView](./docs/editRowEnable.png)](./docs/editRowEnable.png)

The controls are extended from popular control [yii2-grid](https://github.com/kartik-v/yii2-grid)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist dacduong/yii2-inlinegrid "*"

```

or add

```
"dacduong/yii2-inlinegrid": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Sample code from yii2-teamhelper module

View:

```
$textInputControlOptions = [
    'class' => 'text-right',
    'maxlength' => 4,
    'size' => 8,
    'defaultValue' => 0,
];
$gridColumns = [
    [
        'class' => SerialColumn::className(),
        'header' => 'No.',
    ],
    [
        'class' => ActionColumn::className(),
        'width' => '100px',
        'alwaysEdit' => true,
        'actionSaveRow' => Url::to('./save-row'),
        'actionReloadRow' => Url::to('./reload-row'),
        'actionDeleteRow' => Url::to('./delete-row'),
        'pageSummary' => 'Total',
    ],
    [
        'class' => HiddenInputColumn::className(),
        'attribute' => 'id',
        'hidden' => true,
    ],
    [
        'class' => Select2Column::className(),
        'attribute' => 'ticket_id',
        'modelFnc' => 'getAvailableTicket',
        'controlOptions' => [
            'options' => [
                'id' => Yii::$app->security->generateRandomString(10),
                'placeholder' => 'Select Ticket',
                'multiple' => false,
            ],
            'pluginOptions' => [
                'ajax' => [
                    'url' => Url::to(['/teamhelper/search/team-object']),
                    'data' => new JsExpression('function(params) { return {q:params.term, type:"ticket"}; }'),
                ],
                'minimumInputLength' => 2,
                'allowClear' => true,
                'width' => '300px',
            ],
        ],
        'pageSummary' => true,
        'pageSummaryFunc' => GridView::F_COUNT,
        'filter' => Select2::widget([
            'model' => $searchModel,
            'attribute' => 'ticket_id',
            'data' => $searchModel->getAvailableTicket(),
            'options' => [
                'id' => Yii::$app->security->generateRandomString(10),
                'placeholder' => 'Select Ticket',
                'multiple' => false,
            ],
            'pluginOptions' => [
                'ajax' => [
                    'url' => Url::to(['/teamhelper/search/team-object']),
                    'data' => new JsExpression('function(params) { return {q:params.term, type:"ticket"}; }'),
                ],
                'minimumInputLength' => 2,
                'allowClear' => true,
            ],
        ]),
    ],
    [
        'class' => TextInputColumn::className(),
        'attribute' => 'day0',
        'format' => ['decimal', 1],
        'pageSummary' => true,
        'controlOptions' => $textInputControlOptions,
        'filter' => false,
        'mergeHeader' => true,
        'hAlign' => GridView::ALIGN_RIGHT,
    ],
    [
        'class' => TextInputColumn::className(),
        'attribute' => 'day1',
        'format' => ['decimal', 1],
        'pageSummary' => true,
        'controlOptions' => $textInputControlOptions,
        'filter' => false,
        'mergeHeader' => true,
        'hAlign' => GridView::ALIGN_RIGHT,
    ],
    [
        'class' => TextInputColumn::className(),
        'attribute' => 'day2',
        'format' => ['decimal', 1],
        'pageSummary' => true,
        'controlOptions' => $textInputControlOptions,
        'filter' => false,
        'mergeHeader' => true,
        'hAlign' => GridView::ALIGN_RIGHT,
    ],
    [
        'class' => TextInputColumn::className(),
        'attribute' => 'day3',
        'format' => ['decimal', 1],
        'pageSummary' => true,
        'controlOptions' => $textInputControlOptions,
        'filter' => false,
        'mergeHeader' => true,
        'hAlign' => GridView::ALIGN_RIGHT,
    ],
    [
        'class' => TextInputColumn::className(),
        'attribute' => 'day4',
        'format' => ['decimal', 1],
        'pageSummary' => true,
        'controlOptions' => $textInputControlOptions,
        'filter' => false,
        'mergeHeader' => true,
        'hAlign' => GridView::ALIGN_RIGHT,
    ],
    [
        'class' => TextareaColumn::className(),
        'attribute' => 'remark',
        'vAlign' => 'top',
        'controlOptions' => [
            'maxlength' => 255,
            'rows' => 2,
            'cols' => 40
        ],
        'filter' => false,
        'mergeHeader' => true
    ],
];

```

Controller:

```
    public function actionSaveRow($week = '') {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $req = Yii::$app->request;
        if ($req->isAjax) {
            $formName = 'Timetable';
            $className = Timetable::className();

            $req = $req->post($formName);
            $rowData = array_values($req)[0];
            $id = $rowData['id'];

            $model = $id > 0 ? $className::findOne($id) : null;
            if ($model == null) {//for insert
                $model = new $className();
            }
            //formName in load function must set to empty
            if ($model->load($rowData, '') && $model->save()) {
            }
            return ['result' => $model, 'errors' => $model->errors];
        }
        return [];
    }

    public function actionReloadRow() {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $req = Yii::$app->request;
        if ($req->isAjax) {
            $className = Timetable::className();

            $id = $req->post('id');

            $model = $id > 0 ? $className::findOne($id) : null;
            if ($model == null) {//for insert
                Yii::error("actionReloadRow fail: no record found for id $id");
                return [];
            }
            return ['result' => $model];
        }
        return [];
    }

    public function actionDeleteRow()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $req = Yii::$app->request;
        if ($req->isAjax) {

            $id = $req->post('id');

            $result = $this->findModel($id)->delete();

            if ($result === false) {
                Yii::error("actionDeleteRow fail: $id");
                return ['errors' => true];
            }
            return ['errors' => false];
        }
        return [];
    }

```

More sample code is available in [yii2-teamhelper repo](https://github.com/dacduong/yii2-teamhelper)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

2

Last Release

3376d ago

Major Versions

v0.9.2 → 1.0.02017-04-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/04f1a92e0a11613835bf763fb1cac447e0695aab92c8d13f81e9d4a8a1d57035?d=identicon)[dacduong](/maintainers/dacduong)

---

Top Contributors

[![dennisnd](https://avatars.githubusercontent.com/u/4587798?v=4)](https://github.com/dennisnd "dennisnd (6 commits)")

---

Tags

yii2extensionwidgetinline gridviewExcel like

### Embed Badge

![Health badge](/badges/dacduong-yii2-inlinegrid/health.svg)

```
[![Health](https://phpackages.com/badges/dacduong-yii2-inlinegrid/health.svg)](https://phpackages.com/packages/dacduong-yii2-inlinegrid)
```

###  Alternatives

[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1358.5k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
