PHPackages                             kartik-v/yii2-grid - 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. kartik-v/yii2-grid

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

kartik-v/yii2-grid
==================

Yii 2 GridView on steroids. Various enhancements and utilities for the Yii 2.0 GridView widget.

v3.5.3(2y ago)5576.6M↓14.4%290[25 issues](https://github.com/kartik-v/yii2-grid/issues)[2 PRs](https://github.com/kartik-v/yii2-grid/pulls)20BSD-3-ClausePHP

Since Jun 28Pushed 2mo ago55 watchersCompare

[ Source](https://github.com/kartik-v/yii2-grid)[ Packagist](https://packagist.org/packages/kartik-v/yii2-grid)[ Docs](https://github.com/kartik-v/yii2-grid)[ Fund](https://opencollective.com/yii2-grid)[ RSS](/packages/kartik-v-yii2-grid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (58)Used By (20)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-grid ---

 [![Donate](https://camo.githubusercontent.com/0336bc43d88554a3f2d6c74dddf312bc2c65c2eacca70d83ae40f5567098d00e/68747470733a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal") [![kartikv](https://camo.githubusercontent.com/0cf29a542375e1a46e84d8bf5805a4e5c0a6ee98b6547ccdc0c55eed49d99c69/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e67)](https://www.buymeacoffee.com/kartikv "Buy me a coffee")
============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-grid------------------)

[![Financial Contributors on Open Collective](https://camo.githubusercontent.com/43fbab15e7601d1b563c62d04067d551a4df9704bfd68f1ad5f8332d31999c87/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f616c6c2f62616467652e7376673f6c6162656c3d66696e616e6369616c2b636f6e7472696275746f7273)](https://opencollective.com/yii2-grid)[![Stable Version](https://camo.githubusercontent.com/78506289f0e61304e71e4a1a9959cc21640c2f70e80d90c0d5cbd6c688427ae5/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d677269642f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-grid)[![Unstable Version](https://camo.githubusercontent.com/0ff848d0491b1481ba79fd63fda9e510e5edd3b6699bec6b993e23530188977a/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d677269642f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-grid)[![License](https://camo.githubusercontent.com/b791bae22b85e6de9db8f0b025b7be046f4ea4bebe31a2974c829a42b04e72e7/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d677269642f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-grid)

[![Total Downloads](https://camo.githubusercontent.com/7c9babe9bce2300c0aca4af6b70d285ac7c67d46e7c173d3c2ea0ecc0e067b57/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d677269642f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-grid)[![Monthly Downloads](https://camo.githubusercontent.com/645d8bbbd4f544217e6b2d24beb3c1acaafb850e43f103f51f2492e27ce64874/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d677269642f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-grid)[![Daily Downloads](https://camo.githubusercontent.com/93dfe421a0adf10233ec0fe14e5c8b3c46a53582aad2bffc30cab1f2d57cdb7e/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d677269642f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-grid)

Yii2 GridView on steroids. A module with various modifications and enhancements to one of the most used widgets by Yii developers. The widget contains new additional Grid Columns with enhanced settings for Yii Framework 2.0. The widget also incorporates various Bootstrap 3.x styling options. Refer [detailed documentation](http://demos.krajee.com/grid) and/or a [complete demo](http://demos.krajee.com/grid-demo). You can also view the [grid grouping demo here](http://demos.krajee.com/group-grid).

[![GridView Screenshot](https://camo.githubusercontent.com/40825c7fe7f98c79cab9ff815e5e0e1ed82675952a8d2c4b966c04bb41edecc4/68747470733a2f2f6c68342e676f6f676c6575736572636f6e74656e742e636f6d2f2d34782d436479795a4173592f564e784c506d61614158492f41414141414141414151382f585959785469515a764a6b2f773836382d683531362d6e6f2f6b72616a65652d796969322d677269642e6a7067)](https://camo.githubusercontent.com/40825c7fe7f98c79cab9ff815e5e0e1ed82675952a8d2c4b966c04bb41edecc4/68747470733a2f2f6c68342e676f6f676c6575736572636f6e74656e742e636f6d2f2d34782d436479795a4173592f564e784c506d61614158492f41414141414141414151382f585959785469515a764a6b2f773836382d683531362d6e6f2f6b72616a65652d796969322d677269642e6a7067)

### Docs &amp; Demo

[](#docs--demo)

You can see detailed [documentation](http://demos.krajee.com/grid), [demonstration](http://demos.krajee.com/grid-demo)and API [code documentation](https://docs.krajee.com/kartik-grid-gridview) on usage of the extension. You can also view the [grid grouping demo here](http://demos.krajee.com/group-grid).

> Note: If you face an issue of bootstrap popovers loading on page load for editable columns - you can disable it by hiding the bootstrap popovers in your yii2 view layout after document ready. For example in your yii2 view layout:

```

$(document).on("ready", function() {
    $('.popover-x:visible').popoverX('hide'); // or use the right CSS selector as per your need
});

```

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

### Pre-requisites

[](#pre-requisites)

Install the necessary pre-requisite (Krajee Dropdown Extension) based on your bootstrap version:

- For Bootstrap v5.x install the extension `kartik-v/yii2-bootstrap5-dropdown`
- For Bootstrap v4.x install the extension `kartik-v/yii2-bootstrap4-dropdown`
- For Bootstrap v3.x install the extension `kartik-v/yii2-dropdown-x`

For example if you are using the Bootstrap v5.x add the following to the `require` section of your `composer.json` file:

```
"kartik-v/yii2-bootstrap5-dropdown": "@dev"

```

### Install

[](#install)

Either run:

```
$ php composer.phar require kartik-v/yii2-grid "@dev"

```

or add

```
"kartik-v/yii2-grid": "@dev"

```

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

Usage
-----

[](#usage)

```
use kartik\grid\GridView;
$gridColumns = [
    ['class' => 'kartik\grid\SerialColumn'],
    [
        'class' => 'kartik\grid\EditableColumn',
        'attribute' => 'name',
        'pageSummary' => 'Page Total',
        'vAlign'=>'middle',
        'headerOptions'=>['class'=>'kv-sticky-column'],
        'contentOptions'=>['class'=>'kv-sticky-column'],
        'editableOptions'=>['header'=>'Name', 'size'=>'md']
    ],
    [
        'attribute'=>'color',
        'value'=>function ($model, $key, $index, $widget) {
            return "   " .
                $model->color . '';
        },
        'filterType'=>GridView::FILTER_COLOR,
        'vAlign'=>'middle',
        'format'=>'raw',
        'width'=>'150px',
        'noWrap'=>true
    ],
    [
        'class'=>'kartik\grid\BooleanColumn',
        'attribute'=>'status',
        'vAlign'=>'middle',
    ],
    [
        'class' => 'kartik\grid\ActionColumn',
        'dropdown' => true,
        'vAlign'=>'middle',
        'urlCreator' => function($action, $model, $key, $index) { return '#'; },
        'viewOptions'=>['title'=>$viewMsg, 'data-toggle'=>'tooltip'],
        'updateOptions'=>['title'=>$updateMsg, 'data-toggle'=>'tooltip'],
        'deleteOptions'=>['title'=>$deleteMsg, 'data-toggle'=>'tooltip'],
    ],
    ['class' => 'kartik\grid\CheckboxColumn']
];
echo GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => $gridColumns,
    'containerOptions' => ['style'=>'overflow: auto'], // only set when $responsive = false
    'beforeHeader'=>[
        [
            'columns'=>[
                ['content'=>'Header Before 1', 'options'=>['colspan'=>4, 'class'=>'text-center warning']],
                ['content'=>'Header Before 2', 'options'=>['colspan'=>4, 'class'=>'text-center warning']],
                ['content'=>'Header Before 3', 'options'=>['colspan'=>3, 'class'=>'text-center warning']],
            ],
            'options'=>['class'=>'skip-export'] // remove this row from export
        ]
    ],
    'toolbar' =>  [
        ['content'=>
            Html::button('&lt;i class="glyphicon glyphicon-plus">&lt;/i>', ['type'=>'button', 'title'=>Yii::t('kvgrid', 'Add Book'), 'class'=>'btn btn-success', 'onclick'=>'alert("This will launch the book creation form.\n\nDisabled for this demo!");']) . ' '.
            Html::a('&lt;i class="glyphicon glyphicon-repeat">&lt;/i>', ['grid-demo'], ['data-pjax'=>0, 'class' => 'btn btn-default', 'title'=>Yii::t('kvgrid', 'Reset Grid')])
        ],
        '{export}',
        '{toggleData}'
    ],
    'pjax' => true,
    'bordered' => true,
    'striped' => false,
    'condensed' => false,
    'responsive' => true,
    'hover' => true,
    'floatHeader' => true,
    'floatHeaderOptions' => ['top' => $scrollingTop],
    'showPageSummary' => true,
    'panel' => [
        'type' => GridView::TYPE_PRIMARY
    ],
]);
```

Contributors
------------

[](#contributors)

### Code Contributors

[](#code-contributors)

This project exists thanks to all the people who contribute. \[[Contribute](.github/CONTRIBUTING.md)\]

[![](https://camo.githubusercontent.com/bc009be169f9ed0826c062e61b4d9675e54f71a854e72a40cec54004e8d823e7/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365)](https://github.com/kartik-v/yii2-grid/graphs/contributors)

### Financial Contributors

[](#financial-contributors)

Become a financial contributor and help us sustain our community. \[[Contribute](https://opencollective.com/yii2-grid/contribute)\]

#### Individuals

[](#individuals)

[![](https://camo.githubusercontent.com/4c27bdea244b0fab7cf4fd2cd3fb51b1cb75ccf86ee117bf385c6769967cbad9/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f696e646976696475616c732e7376673f77696474683d383930)](https://opencollective.com/yii2-grid)

#### Organizations

[](#organizations)

Support this project with your organization. Your logo will show up here with a link to your website. \[[Contribute](https://opencollective.com/yii2-grid/contribute)\]

[![](https://camo.githubusercontent.com/c6ddd9032727620988e68e8d1ce8192ff62c33afd74ac712ba101107ad19889b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f302f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/0/website)[![](https://camo.githubusercontent.com/97b6b3dff920dc2f6c2d5e40b7187bbdecdb598529dcc111e0c6901d547234cb/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f312f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/1/website)[![](https://camo.githubusercontent.com/c8253bcccdcc2e98e9356ec61a9cd1a0e8f1601c57e017dff4fedcf97f7ae4f7/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f322f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/2/website)[![](https://camo.githubusercontent.com/bd45af865b54cc4369682990bd5516e60c84289f98790da7cb98dc2ccd4edd56/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f332f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/3/website)[![](https://camo.githubusercontent.com/8332e3c9c336e21dfb9598d2010579dc9dd2df838af8fbf87ffe4a62ace2f196/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f342f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/4/website)[![](https://camo.githubusercontent.com/d2265949b8e39c9c18ef6bdcb1845a961f1055b1da918f731b5f75b23b155495/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f352f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/5/website)[![](https://camo.githubusercontent.com/91d344b7778bc6524d56d9d80b4079048b2aadceb0d7506f31eab4bcb334e3b5/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f362f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/6/website)[![](https://camo.githubusercontent.com/a1719e8c5f4806e22b6c6ed22d2379914bbed430ce725da5dc7f49bebae4fee7/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f372f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/7/website)[![](https://camo.githubusercontent.com/80607b02526fc735faa44ffca89dd98b697e20e2e2141ae645325f5a219eb066/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f382f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/8/website)[![](https://camo.githubusercontent.com/302b3148cfeb56dd332ac442c9096c5468a0d10f03b335d956bd5dab5fec9d26/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d677269642f6f7267616e697a6174696f6e2f392f6176617461722e737667)](https://opencollective.com/yii2-grid/organization/9/website)

License
-------

[](#license)

**yii2-grid** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance56

Moderate activity, may be stable

Popularity68

Solid adoption and visibility

Community53

Growing community involvement

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 88.7% 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 ~59 days

Recently: every ~172 days

Total

57

Last Release

1029d ago

Major Versions

v1.9.0 → v2.0.02014-10-11

v2.9.0 → v3.0.02015-02-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (684 commits)")[![derekisbusy](https://avatars.githubusercontent.com/u/5118781?v=4)](https://github.com/derekisbusy "derekisbusy (8 commits)")[![thiagotalma](https://avatars.githubusercontent.com/u/612578?v=4)](https://github.com/thiagotalma "thiagotalma (6 commits)")[![XzAeRo](https://avatars.githubusercontent.com/u/1656037?v=4)](https://github.com/XzAeRo "XzAeRo (6 commits)")[![pappfer](https://avatars.githubusercontent.com/u/738623?v=4)](https://github.com/pappfer "pappfer (5 commits)")[![boehsermoe](https://avatars.githubusercontent.com/u/2466744?v=4)](https://github.com/boehsermoe "boehsermoe (5 commits)")[![lestat1968](https://avatars.githubusercontent.com/u/7681695?v=4)](https://github.com/lestat1968 "lestat1968 (4 commits)")[![kenjebaev](https://avatars.githubusercontent.com/u/20373911?v=4)](https://github.com/kenjebaev "kenjebaev (4 commits)")[![fruppel](https://avatars.githubusercontent.com/u/3985601?v=4)](https://github.com/fruppel "fruppel (4 commits)")[![muhammadcahya](https://avatars.githubusercontent.com/u/4241620?v=4)](https://github.com/muhammadcahya "muhammadcahya (3 commits)")[![almirb](https://avatars.githubusercontent.com/u/1752962?v=4)](https://github.com/almirb "almirb (3 commits)")[![vishuB](https://avatars.githubusercontent.com/u/13677102?v=4)](https://github.com/vishuB "vishuB (3 commits)")[![dvdkrgr](https://avatars.githubusercontent.com/u/11403884?v=4)](https://github.com/dvdkrgr "dvdkrgr (2 commits)")[![Deele](https://avatars.githubusercontent.com/u/477326?v=4)](https://github.com/Deele "Deele (2 commits)")[![monghuz](https://avatars.githubusercontent.com/u/1073614?v=4)](https://github.com/monghuz "monghuz (2 commits)")[![anothersoftware-lv](https://avatars.githubusercontent.com/u/9327511?v=4)](https://github.com/anothersoftware-lv "anothersoftware-lv (2 commits)")[![nbogol](https://avatars.githubusercontent.com/u/2125591?v=4)](https://github.com/nbogol "nbogol (2 commits)")[![newerton](https://avatars.githubusercontent.com/u/4175945?v=4)](https://github.com/newerton "newerton (2 commits)")[![niki7har](https://avatars.githubusercontent.com/u/17407292?v=4)](https://github.com/niki7har "niki7har (2 commits)")[![darcoder](https://avatars.githubusercontent.com/u/6381560?v=4)](https://github.com/darcoder "darcoder (2 commits)")

---

Tags

gridyii2extensionwidget

### Embed Badge

![Health badge](/badges/kartik-v-yii2-grid/health.svg)

```
[![Health](https://phpackages.com/badges/kartik-v-yii2-grid/health.svg)](https://phpackages.com/packages/kartik-v-yii2-grid)
```

###  Alternatives

[kartik-v/yii2-widget-datetimepicker

Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)

1036.5M47](/packages/kartik-v-yii2-widget-datetimepicker)[kartik-v/yii2-widget-typeahead

Enhanced Yii2 wrapper for the Twitter Typeahead plugin (sub repo split from yii2-widgets).

454.8M9](/packages/kartik-v-yii2-widget-typeahead)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-sortable

Create sortable lists and grids using HTML5 drag and drop API for Yii 2.0.

433.8M13](/packages/kartik-v-yii2-sortable)[kartik-v/yii2-detail-view

Enhanced Yii 2 Detail View widget with special Bootstrap styles, ability to edit data, and more.

701.1M41](/packages/kartik-v-yii2-detail-view)[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

324.8M10](/packages/kartik-v-yii2-widget-colorinput)

PHPackages © 2026

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