kartik-v/yii2-sortable Create sortable lists and grids using HTML5 drag and drop API for Yii 2.0.

extensionwidgetbootstrapjqueryrangesortable

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.

Changelog

Change Log: yii2-sortable

Version 1.2.2

Date: 09-Oct-2018

  • Bump up composer dependencies.

Version 1.2.1

Date: 03-Sep-2018

  • (enh #17): Update to use newer plugin methods.
  • Updates to support bootstrap v4.x.
  • (enh #15, #16): Create new jquery plugin kvHtml5Sortable based on html5sortable.
  • Update to use latest release library of html5sortable.
  • Move all relevant code to new src directory.
  • Add github contribution and issue/PR logging templates.

Version 1.2.0

Date: 17-Jun-2015

  • (enh #9): Set composer ## Version dependencies.
  • (enh #7): Correct documentation link.
  • (enh #5): Allow multiple connected sortables on single page. With this enhancement, the connected property will follow these rules:
    • if set to false or null/empty this widget will not be connected to any other sortable widget.
    • if set to true, this widget will be connected to all other sortable widgets on the page with connected property set to true.
    • if set to a string - this widget will be connected with other sortable widgets matching the same connected string value.
  • Upgrade sortable plugin to [use new fork](https://github.com/kartik-v/yii2-sortable/blob/master/(https://github.com/voidberg/html5sortable).

Version 1.1.0

Date: 10-Nov-2014

  • Set dependency on Krajee base components
  • Set release to stable

Version 1.0.0

Date: 01-Jul-2014

  • Initial release
  • PSR4 alias change

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



v1.2.2 is the latest of 5 releases



BSD-3-Clause license
Stats
43 github stars & 20 github forks
1715 downloads in the last day
46346 downloads in the last 30 days
2652108 total downloads