PHPackages                             isavon/yii2-sortablegrid - 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. isavon/yii2-sortablegrid

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

isavon/yii2-sortablegrid
========================

The extension for Yii2 Framework

1.0(3y ago)03MITPHP

Since Jul 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/isavon/yii2-sortablegrid)[ Packagist](https://packagist.org/packages/isavon/yii2-sortablegrid)[ RSS](/packages/isavon-yii2-sortablegrid/feed)WikiDiscussions master Synced today

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

 yii2-sortablegrid ---

========================

[](#----yii2-sortablegrid----)

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

[](#installation)

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

To install, either run

```
$ php composer.phar require isavon/yii2-sortablegrid "@dev"

```

or add

```
"isavon/yii2-sortablegrid": "@dev"

```

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

Changes
-------

[](#changes)

> NOTE: Refer the [CHANGE LOG](https://github.com/isavon/yii2-sortablegrid/blob/master/CHANGE.md) for details on changes to various releases.

Usage
-----

[](#usage)

Add SortableGridAction to your controller.

```
public function actions()
{
    return [
        SortableGridAction::SORTABLE_ACTION => [
            'class' => SortableGridAction::className(),
            'modelName' => Model::className(),
        ],
    ];
}
```

Add SortableGridBehavior to your model.

```
public function behaviors()
{
    return [
        [
            'class' => SortableGridBehavior::className(),
            'sortableAttribute' => 'sortOrder',
        ],
    ];
}
```

And add SortableGridView to your view file.

```
