kartik-v/yii2-sortable

Create sortable lists and grids using HTML5 drag and drop API for Yii 2.0.

Maintainers

👁 kartik-v

Package info

github.com/kartik-v/yii2-sortable

Language:JavaScript

Type:yii2-extension

pkg:composer/kartik-v/yii2-sortable

Statistics

Installs: 4 016 021

Dependents: 25

Suggesters: 0

Stars: 43

Open Issues: 1

v1.2.2 2018-10-09 13:25 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause a6f9a9adb873d6345de92bbe5e436ac1a1db30bc

jquerybootstrapsortableextensionwidgetrangeyii2

This package is auto-updated.

Last update: 2026-06-25 23:03:25 UTC


README

👁 Krajee Logo

yii2-sortable 👁 Donate

👁 Stable Version
👁 Unstable Version
👁 License
👁 Total Downloads
👁 Monthly Downloads
👁 Daily Downloads

A Yii 2.0 widget that allows you to create sortable lists and grids and manipulate them using simple drag and drop. It is based on the lightweight html5sortable jQuery plugin, which uses native HTML5 API for drag and drop. It is a leaner alternative for the JUI Sortable plugin and offers very similar functionality. The yii2-sortable widget offers these features:

  • Less than 1KB of javascript used (minified and gzipped).
  • Built using native HTML5 drag and drop API.
  • Supports both list and grid style layouts.
  • Similar API and behaviour to jquery-ui sortable plugin.
  • Works in IE 5.5+, Firefox 3.5+, Chrome 3+, Safari 3+ and, Opera 12+.

Demo

You can see detailed documentation on usage of the extension.

Installation

The preferred way to install this extension is through composer.

NOTE: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

Either run

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

or add

"kartik-v/yii2-sortable": "@dev"

to the require section of your composer.json file.

Usage

Sortable

use kartik\sortable\Sortable;
echo Sortable::widget([
 'type' => Sortable::TYPE_LIST,
 'items' => [
 ['content' => 'Item # 1'],
 ['content' => 'Item # 2'],
 ['content' => 'Item # 3'],
 ] 
]); 

License

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