PHPackages                             kartik-v/yii2-dynagrid - 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. [Framework](/categories/framework)
4. /
5. kartik-v/yii2-dynagrid

ActiveYii2-extension[Framework](/categories/framework)

kartik-v/yii2-dynagrid
======================

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

v1.5.5(2y ago)743.1M—0.5%6320BSD-3-ClausePHP

Since Sep 20Pushed 1y ago10 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (20)Used By (20)

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

 [![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-dynagrid------------------)

[![Latest Stable Version](https://camo.githubusercontent.com/9006ff8f63dc5bd573b9389a38a37547a26c9fa974bc0b197d90b0bc25354ffc/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d64796e61677269642f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-dynagrid)[![Latest Unstable Version](https://camo.githubusercontent.com/b29c8bc5f4cf662ab5acf106c081ed3fb27d6c4c5ee5d719e377d9bcb4866759/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d64796e61677269642f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-dynagrid)[![License](https://camo.githubusercontent.com/50ee01e2825be7ea692656e59ba4c1ec422fea628f528411eacc6928bb486056/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d64796e61677269642f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-dynagrid)[![Total Downloads](https://camo.githubusercontent.com/b7d303a821f8ea700636abf16c56ef15829cb0898cee58d9390bee554e0eee40/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d64796e61677269642f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-dynagrid)[![Monthly Downloads](https://camo.githubusercontent.com/91b004ca11b48d802a3a7ca1897daf1f79ee6dca6b4a65395096f05b6dbfae41/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d64796e61677269642f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-dynagrid)[![Daily Downloads](https://camo.githubusercontent.com/8dfd87bab12ce69f0ed6fb7d9d36fed100936bfebd0f803a1b7a6b5e62232e79/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d64796e61677269642f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-dynagrid)

The **yii2-dynagrid** module is a great complementary addition to the [kartik-v/yii2-grid](https://github.com/kartik-v/yii2-grid) module, enhancing it with personalization features. It turbo charges your grid view by making it dynamic and personalized for each user. It allows users the ability to set and save their own grid configuration. The major features provided by this module are:

- Personalize, set, and save grid page size at runtime. You can set the minimum and maximum page size allowed.
- Personalize, set, and save grid data filters at runtime. A user can define and save his/her own personalized grid data filters.
- Personalize, set, and save grid column sorts at runtime. A user can define and save his/her own personalized grid column sorts.
- Personalize the grid columns display through drag and drop. Reorder grid columns and set the visibility of needed columns, and allow users to save this setting. Control which columns can be reordered by users through predefined columns setup. Predetermine which of your desired columns will be always fixed to the left or right by default.
- Personalize grid appearance and set the grid theme. This will offer advanced customization to the grid layout. It allows users to virtually style grid anyway they want, based on how you define themes and extend them to your users. Since the extension uses the [yii2-grid](https://github.com/kartik-v/yii2-grid)extension,it offers all the styling options the **yii2-grid** extension provides, including the various grid column enhancements, bootstrap panels, and other grid styles. This will allow you to easily setup themes for users in many ways. You have an ability to setup multiple themes in your module configuration, and allow users to select one of them. The extension by default includes some predefined themes for you to get started.
- Allow you to save the dynamic grid configuration specific to each user or global level. Implements a `DynaGridStore` object to manage dynagrid personalizations independent of storage. One of the following storage options are made available to store the personalized grid configuration:
    - Session Storage (default)
    - Cookie Storage
    - Database Storage
- The extension automatically validates and loads the saved configuration based on the stored settings.

> NOTE: This extension depends on the [kartik-v/yii2-grid](https://github.com/kartik-v/yii2-grid) and [kartik-v/yii2-sortable](https://github.com/kartik-v/yii2-sortable) extensions which in turn depends on the [yiisoft/yii2-bootstrap](https://github.com/yiisoft/yii2/tree/master/extensions/bootstrap) extension. Check the [composer.json](https://github.com/kartik-v/yii2-dynagrid/blob/master/composer.json) for this extension's requirements and dependencies.

Latest Release
--------------

[](#latest-release)

Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-dynagrid/blob/master/CHANGE.md) for details on changes to various releases.

- With v1.2.0, the Dynagrid is revamped to include a `DynaGridStore` object and ability to save, update, or delete grid personalizations including grid filter and sort.
- With v1.1.0, the DynaGrid includes Pjax support. To enable Pjax processing, set `gridOptions['pjax']` property to `true` and control pjax behavior using `gridOptions['pjaxSettings']`.

How to contribute via a pull request?
-------------------------------------

[](#how-to-contribute-via-a-pull-request)

Refer this [git workflow for contributors](.github/GIT-WORKFLOW.md).

### Demo

[](#demo)

You can see detailed [documentation](http://demos.krajee.com/dynagrid), view the [API Code Documentation](https://docs.krajee.com/kartik-dynagrid-dynagrid) or view a [complete demo](http://demos.krajee.com/dynagrid-demo) on usage of the extension.

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

[](#installation)

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

> Note: Check the [composer.json](https://github.com/kartik-v/yii2-dynagrid/blob/master/composer.json) for this extension's requirements and dependencies. 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.

Either run

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

```

or add

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

```

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

Usage
-----

[](#usage)

### Module

[](#module)

Setup the module in your Yii configuration file with a name `dynagrid` as shown below. In addition, you must also register the `gridview` module as described in the [yii2-grid documentation](http://demos.krajee.com/grid#module).

```
'modules'=>[
   'dynagrid'=>[
        'class'=>'\kartik\dynagrid\Module',
        // other settings (refer documentation)
    ],
    'gridview'=>[
        'class'=>'\kartik\grid\Module',
        // other module settings
    ],
],
```

### DynaGrid

[](#dynagrid)

The DynaGrid widget can be used to render the personalized &amp; dynamic version of `kartik\Grid\GridView` in the following way:

```
use kartik\dynagrid\DynaGrid;
use kartik\grid\GridView;
$columns = [
    ['class'=>'kartik\grid\SerialColumn', 'order'=>DynaGrid::ORDER_FIX_LEFT],
    'id',
    'name',
    [
        'attribute'=>'publish_date',
        'filterType'=>GridView::FILTER_DATE,
        'format'=>'raw',
        'width'=>'170px',
        'filterWidgetOptions'=>[
            'pluginOptions'=>['format'=>'yyyy-mm-dd']
        ],
    ],
    [
        'class'=>'kartik\grid\BooleanColumn',
        'attribute'=>'status',
        'vAlign'=>'middle',
    ],
    [
        'class'=>'kartik\grid\ActionColumn',
        'dropdown'=>false,
        'order'=>DynaGrid::ORDER_FIX_RIGHT
    ],
    ['class'=>'kartik\grid\CheckboxColumn',  'order'=>DynaGrid::ORDER_FIX_RIGHT],
];

echo DynaGrid::widget([
    'columns'=>$columns,
    'storage'=>DynaGrid::TYPE_COOKIE,
    'theme'=>'panel-danger',
    'gridOptions'=>[
        'dataProvider'=>$dataProvider,
        'filterModel'=>$searchModel,
        'panel'=>['heading'=>'Library'],
    ],
    'options'=>['id'=>'dynagrid-1'] // a unique identifier is important
]);
```

> Warning: You need to be careful, in case you are using the new `\kartik\grid\FormulaColumn` in your grid layout. The reordering of columns by users will render your formulae invalid, since the column indices will change. It is recommended, you set the order of all such formulae columns and its dependencies to `DynaGrid::ORDER_FIX_LEFT`, so that such column positions are pre-fixed.

License
-------

[](#license)

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

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity58

Moderate usage in the ecosystem

Community41

Growing community involvement

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 83.1% 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 ~179 days

Recently: every ~403 days

Total

19

Last Release

1029d ago

### 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 (182 commits)")[![philippfrenzel](https://avatars.githubusercontent.com/u/2319890?v=4)](https://github.com/philippfrenzel "philippfrenzel (4 commits)")[![leifox](https://avatars.githubusercontent.com/u/15732086?v=4)](https://github.com/leifox "leifox (3 commits)")[![ittaskeu](https://avatars.githubusercontent.com/u/23516846?v=4)](https://github.com/ittaskeu "ittaskeu (3 commits)")[![gvasilopulos](https://avatars.githubusercontent.com/u/7271039?v=4)](https://github.com/gvasilopulos "gvasilopulos (2 commits)")[![monghuz](https://avatars.githubusercontent.com/u/1073614?v=4)](https://github.com/monghuz "monghuz (2 commits)")[![pgyf](https://avatars.githubusercontent.com/u/3365344?v=4)](https://github.com/pgyf "pgyf (2 commits)")[![stivehu](https://avatars.githubusercontent.com/u/13046582?v=4)](https://github.com/stivehu "stivehu (2 commits)")[![lukascernydis](https://avatars.githubusercontent.com/u/3111717?v=4)](https://github.com/lukascernydis "lukascernydis (1 commits)")[![maczkop](https://avatars.githubusercontent.com/u/18721433?v=4)](https://github.com/maczkop "maczkop (1 commits)")[![matteo-cerioni](https://avatars.githubusercontent.com/u/18422237?v=4)](https://github.com/matteo-cerioni "matteo-cerioni (1 commits)")[![maz0717](https://avatars.githubusercontent.com/u/8954653?v=4)](https://github.com/maz0717 "maz0717 (1 commits)")[![nidgetgod](https://avatars.githubusercontent.com/u/4176953?v=4)](https://github.com/nidgetgod "nidgetgod (1 commits)")[![purupurupururu](https://avatars.githubusercontent.com/u/209989252?v=4)](https://github.com/purupurupururu "purupurupururu (1 commits)")[![rafaelwithoeft](https://avatars.githubusercontent.com/u/6033499?v=4)](https://github.com/rafaelwithoeft "rafaelwithoeft (1 commits)")[![theill11](https://avatars.githubusercontent.com/u/3434113?v=4)](https://github.com/theill11 "theill11 (1 commits)")[![TonisOrmisson](https://avatars.githubusercontent.com/u/6357451?v=4)](https://github.com/TonisOrmisson "TonisOrmisson (1 commits)")[![werewolf8904](https://avatars.githubusercontent.com/u/23662660?v=4)](https://github.com/werewolf8904 "werewolf8904 (1 commits)")[![antoniom](https://avatars.githubusercontent.com/u/842181?v=4)](https://github.com/antoniom "antoniom (1 commits)")[![XzAeRo](https://avatars.githubusercontent.com/u/1656037?v=4)](https://github.com/XzAeRo "XzAeRo (1 commits)")

---

Tags

gridsortyii2extensionhidewidgetdynamicordervisibilityshowreordercolumns

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-grid

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

5576.6M179](/packages/kartik-v-yii2-grid)[miloschuman/yii2-highcharts-widget

Highcharts widget for Yii 2 Framework.

1761.5M14](/packages/miloschuman-yii2-highcharts-widget)[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)[sjaakp/yii2-sortable-behavior

Sort ActiveRecords and related records in Yii2.

36144.7k](/packages/sjaakp-yii2-sortable-behavior)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[thiagotalma/yii2-fullcalendar

Widget for Yii Framework 2.0 to use FullCalendar

1777.7k](/packages/thiagotalma-yii2-fullcalendar)

PHPackages © 2026

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