PHPackages                             knik/yii2-sortable-widgets - 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. knik/yii2-sortable-widgets

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

knik/yii2-sortable-widgets
==========================

Implementation Rubaxa/Sortable for Yii2. Sortable grid view inside.

v2.0.2(10y ago)070MITPHP

Since Oct 14Pushed 9y agoCompare

[ Source](https://github.com/ET-NiK/yii2-sortable-widgets)[ Packagist](https://packagist.org/packages/knik/yii2-sortable-widgets)[ Docs](http://github.com/kotchuprik/yii2-sortable-widgets)[ RSS](/packages/knik-yii2-sortable-widgets/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (8)Used By (0)

Yii2 Sortable widgets
=====================

[](#yii2-sortable-widgets)

[![Join the chat at https://gitter.im/kotchuprik/yii2-sortable-widgets](https://camo.githubusercontent.com/9b4fb563d78d1184c04363a644414f8a764097599e86f5002a4c8021f0886261/68747470733a2f2f6261646765732e6769747465722e696d2f6b6f746368757072696b2f796969322d736f727461626c652d776964676574732e737667)](https://gitter.im/kotchuprik/yii2-sortable-widgets?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Implementation Rubaxa/Sortable for Yii2 widgets.

Supported:

- GridView widget.

[![demo](https://camo.githubusercontent.com/32974438c1f9e42303245a2e565868806ed24b0d2560d6e13bf1f04d8c3a486a/68747470733a2f2f6873746f2e6f72672f66696c65732f3630652f6537612f6365642f36306565376163656437373934613633386430613633363530363233393761642e676966)](https://camo.githubusercontent.com/32974438c1f9e42303245a2e565868806ed24b0d2560d6e13bf1f04d8c3a486a/68747470733a2f2f6873746f2e6f72672f66696c65732f3630652f6537612f6365642f36306565376163656437373934613633386430613633363530363233393761642e676966)

[![Latest Stable Version](https://camo.githubusercontent.com/fdda4f565370b9946a3ca859cd73ce005fe810c497908572c9c0d80e07426021/68747470733a2f2f706f7365722e707567782e6f72672f6b6f746368757072696b2f796969322d736f727461626c652d776964676574732f762f737461626c65)](https://packagist.org/packages/kotchuprik/yii2-sortable-widgets)[![Total Downloads](https://camo.githubusercontent.com/b3ba5ef458c06e9685b4d18c7fe4b423e95f2a4fcda57ba1ff993d5b5fab7cbf/68747470733a2f2f706f7365722e707567782e6f72672f6b6f746368757072696b2f796969322d736f727461626c652d776964676574732f646f776e6c6f616473)](https://packagist.org/packages/kotchuprik/yii2-sortable-widgets)[![Monthly Downloads](https://camo.githubusercontent.com/f0574acb77ed5a5e9a018b4dd6262b534deb35d4e9d7dd603ef5bec818d4ab7a/68747470733a2f2f706f7365722e707567782e6f72672f6b6f746368757072696b2f796969322d736f727461626c652d776964676574732f642f6d6f6e74686c79)](https://packagist.org/packages/kotchuprik/yii2-sortable-widgets)[![Latest Unstable Version](https://camo.githubusercontent.com/b5881e31ef833da68ead997a0025e349d1ed3d59688782b2e96ccaf1a18be4d4/68747470733a2f2f706f7365722e707567782e6f72672f6b6f746368757072696b2f796969322d736f727461626c652d776964676574732f762f756e737461626c65)](https://packagist.org/packages/kotchuprik/yii2-sortable-widgets)[![License](https://camo.githubusercontent.com/c4b6e972f66caf2310af2043126cdec2a558656c529bfe6a76dc992980a75a09/68747470733a2f2f706f7365722e707567782e6f72672f6b6f746368757072696b2f796969322d736f727461626c652d776964676574732f6c6963656e7365)](https://packagist.org/packages/kotchuprik/yii2-sortable-widgets)

Usage
-----

[](#usage)

Create a new migration, change a parent to the migration class from the extension and specify the table name property:

```
class m140811_131705_Models_order extends \kotchuprik\sortable\migrations\Migration
{
    protected $tableName = 'models';
}
```

Add the sortable behavior to your model and specify the query property:

```
public function behaviors()
{
    return [
        'sortable' => [
            'class' => \kotchuprik\sortable\behaviors\Sortable::className(),
            'query' => self::find(),
        ],
    ];
}
```

Add the sorting action to your controller and specify the query property:

```
public function actions()
{
    return [
        'sorting' => [
            'class' => \kotchuprik\sortable\actions\Sorting::className(),
            'query' => \vendor\namespace\Model::find(),
        ],
    ];
}
```

Add the column to your grid view and specify the sorting url like here:

```
echo \yii\grid\GridView::widget([
    'dataProvider' => $model->search(),
    'rowOptions' => function ($model, $key, $index, $grid) {
        return ['data-sortable-id' => $model->id];
    },
    'columns' => [
        [
            'class' => \kotchuprik\sortable\grid\Column::className(),
        ],
        'id',
        'title',
        'order',
    ],
    'options' => [
        'data' => [
            'sortable-widget' => 1,
            'sortable-url' => \yii\helpers\Url::toRoute(['sorting']),
        ]
    ],
]);
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 90.6% 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 ~151 days

Total

5

Last Release

3672d ago

Major Versions

1.0.1 → v2.0.02015-08-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1330709?v=4)[knik](/maintainers/knik)[@knik](https://github.com/knik)

---

Top Contributors

[![chuprik](https://avatars.githubusercontent.com/u/802946?v=4)](https://github.com/chuprik "chuprik (29 commits)")[![sluchznak](https://avatars.githubusercontent.com/u/4091442?v=4)](https://github.com/sluchznak "sluchznak (2 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

gridsortableyii2sortingjQueryUIgridviewdnd

### Embed Badge

![Health badge](/badges/knik-yii2-sortable-widgets/health.svg)

```
[![Health](https://phpackages.com/badges/knik-yii2-sortable-widgets/health.svg)](https://phpackages.com/packages/knik-yii2-sortable-widgets)
```

###  Alternatives

[kotchuprik/yii2-sortable-widgets

Implementation Rubaxa/Sortable for Yii2. Sortable grid view inside.

61137.0k6](/packages/kotchuprik-yii2-sortable-widgets)[himiklab/yii2-sortable-grid-view-widget

Sortable modification of standard Yii2 GridView widget

79358.0k7](/packages/himiklab-yii2-sortable-grid-view-widget)[paulzi/yii2-sortable

Sortable Behavior for Yii2

15320.4k4](/packages/paulzi-yii2-sortable)

PHPackages © 2026

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