PHPackages                             ale10257/yii2-sortable-widget - 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. ale10257/yii2-sortable-widget

ActiveLibrary[Framework](/categories/framework)

ale10257/yii2-sortable-widget
=============================

Easy sortable Yii2 widget

v1.0.2(4y ago)07BSD-3-ClausePHPPHP &gt;=7.4

Since Nov 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ale10257/yii2-sortable-widget)[ Packagist](https://packagist.org/packages/ale10257/yii2-sortable-widget)[ RSS](/packages/ale10257-yii2-sortable-widget/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

### Yi2 sortable widget based on [sortablejs](https://github.com/SortableJS/Sortable)

[](#yi2-sortable-widget-based-on-sortablejs)

The widget is a wrapper over sortablejs that allows you to drag and drop any elements on the html page.
Also, the widget includes two services (SortableServicePostgres and SortableService) for working with the database. That is, after dragging and dropping elements on the page, the sorting order in the database also changes.

**Service differences**

1. SortableServicePostgres works only with Postgres DB, SortableService with any DB supported by Yii2
2. SortableServicePostgres always has a sorting step of 10, in SortableService the step can be configured

**Installation widget**: `composer require ale10257/yii2-sortable-widget`

**Usage**

In the View file:

```
