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

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

bupy7/yii2-grid
===============

Simple extended `yii\\grid\\GridView` with buns.

1.1.6(8y ago)82.4k↓66.7%5[1 issues](https://github.com/bupy7/yii2-grid/issues)BSD-3-ClausePHP

Since Jul 23Pushed 8y ago4 watchersCompare

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

READMEChangelog (9)Dependencies (3)Versions (10)Used By (0)

yii2-grid
=========

[](#yii2-grid)

Simple extended `yii\grid\GridView`.

**Features:**

- Wrapping GridView in [Bootstrap3 Panel](http://getbootstrap.com/components/#panels).
- Ability changing size of page.
- Column of 'Total' with ability using custom formulas.
- Hard-header.
- Custom tags of template the GridView.
- Ability disabling/enabling/sort visible columns of real-time.
- Ability resize width of columns.
- Keepping last modified page sizer.

[![Screenshot1](docs/screenshot1.png)](docs/screenshot1.png)

[![Screenshot2](docs/screenshot2.png)](docs/screenshot2.png)

[![Screenshot3](docs/screenshot3.png)](docs/screenshot3.png)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist bupy7/yii2-grid "*"

```

or add

```
"bupy7/yii2-grid": "*"

```

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

Usage
-----

[](#usage)

### Simple usage

[](#simple-usage)

```
use bupy7\grid\GridView;

echo GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],
        ['class' => 'yii\grid\CheckboxColumn'],
        'attribute1',
        'attribute2',
    ],
]);
```

### Adding delete button

[](#adding-delete-button)

Adding your view:

```
use bupy7\grid\GridView;

$panelHeadingTemplate =  [
        'controls' => $this->render('_controls'),
    ],
    'panelHeadingTemplate' => $panelHeadingTemplate,
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],
        ['class' => 'yii\grid\CheckboxColumn'],
        'attribute1',
        'attribute2',
    ],
]);
```

Adding your `_controls` view:

```
