toir427/yii2-sortablejs

SortableJS 扩展的 Yii2 实现。可用于创建和拖拽排序列表。适用于现代浏览器和触摸设备。

安装次数: 4

依赖关系: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

公开问题: 0

类型:yii2-extension

1.0.0 2020-10-30 09:54 UTC

This package is auto-updated.

Last update: 2024-09-29 05:56:01 UTC


README

这是 Yii 框架 2.0SortableJS 扩展的实现。可用于创建和拖拽排序列表。适用于现代浏览器和触摸设备。

Latest Stable Version Code Climate Total Downloads License

安装

安装此扩展的首选方式是通过 composer

运行

php composer.phar require toir427/yii2-sortablejs

或添加

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

到您的 composer.json 文件的 require 部分中。

用法

use toir427\sortablejs\Sortable;

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

示例

更多 示例

配置

关于此扩展的配置,请参阅 SortableJS 选项

许可

yii2-sortablejs 在 Apache 2.0 许可下发布。有关详细信息,请参阅 LICENSE.md