toir427/yii2-sortablejs

Yii2 implementation of SortableJS extension. To create and reorder lists with drag-and-drop. For use with modern browsers and touch devices.

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.0 2020-10-30 09:54 UTC

This package is auto-updated.

Last update: 2024-05-29 04:55:35 UTC


README

This is an Yii framework 2.0 implementation of SortableJS extension. To create and reorder lists with drag-and-drop. For use with modern browsers and touch devices.

Latest Stable Version Code Climate Total Downloads License

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require toir427/yii2-sortablejs

or add

"toir427/yii2-sortablejs": "^1.0"

to the require section of your composer.json file.

Usage

use toir427\sortablejs\Sortable;

<?= Sortable::widget([
    'items' => [
        'Item 1',
        ['content' => 'Item2'],
        [
            'content' => 'Item3',
            'options' => ['class' => 'text-danger'],
        ],
    ],
    'clientOptions' => [
        'selectedClass'     => 'selected',
        'fallbackTolerance' => 3,
        'animation'         => 150,
    ],
]); ?>

Examples

More Examples.

Configurations

For this extension configuration see SortableJS Options.

License

yii2-sortablejs is released under the Apache 2.0 License. See the LICENSE.md for details.