kartik-v/yii2-sortable-input Sortable input widget based on yii2-sortable extension.

extensionwidgetbootstrapjqueryrangesortableinput

Krajee Logo
yii2-sortable-input Donate

Stable Version Unstable Version License Total Downloads Monthly Downloads Daily Downloads

An input widget for Yii 2.0 widget based on the yii2-sortable extension that allows you to create sortable-input lists and grids and manipulate them using simple drag and drop. It extends the yii2-sortable features by allowing you to store the sort order in a form input (which is hidden by default). The widget stores the order as delimited list item keys. The widget includes additional jQuery enhancements to initialize the list, trap sortable order change, and reset order on form reset.

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-input "dev-master"

or add

"kartik-v/yii2-sortable-input": "dev-master"

to the require section of your composer.json file.

Usage

SortableInput

use kartik\sortinput\SortableInput;
echo SortableInput::widget([
    'model' => $model,
    'attribute' => 'sort_list',
    'hideInput' => false,
    'delimiter' => '~',
    'items' => [
        1 => ['content' => 'Item # 1'],
        2 => ['content' => 'Item # 2'],
        3 => ['content' => 'Item # 3'],
        4 => ['content' => 'Item # 4', 'disabled'=>true],
    ]   
]);

License

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

Changelog

Change Log: yii2-sortable-input

Version 1.2.1

Date: 29-Aug-2018

  • (bug #12): Correct sortable input plugin for the latest html5sortable release.
  • Add github contribution and PR/issue log templates.
  • Fix composer settings
  • Update copyright year to current.
  • Reorganize source code in src directory.

Version 1.2.0

Date: 29-Jan-2015

  • (enh #1): Plugin enhancement to update parent keys for connected sortables.

Version 1.1.0

Date: 10-Nov-2014

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

Version 1.0.0

Date: 01-Aug-2014

  • Initial release
  • PSR4 alias change

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



v1.2.1 is the latest of 3 releases



BSD-3-Clause license
Stats
23 github stars & 9 github forks
399 downloads in the last day
9032 downloads in the last 30 days
507707 total downloads