unisharp/dndsort
Composer 安装命令:
composer require unisharp/dndsort
包简介
Help building sorted list items.
README 文档
README
Help building sorted list items by jQuery.
Installation
- this plugin requires jQuery and jQuery-UI
Initialization
-
generate list items :
$('ul#sortable').sortable(); $('#sortable').dndsort('init', { data : [], // set your items submit_name : 'sorted', // set sorted input field name labels : {}, // set labels for new item and buttons attrs : {}, // set attributes for list and buttons render : func_render // set custom rendering function });
-
generate new item in list
$('#new-data').click(function(){ $('#sortable').dndsort('new'); });
-
generate sorted data
$('#submit').click(function(){ $('#sortable').dndsort('save'); });
this make input like below :
<input type='text' name='sorted' value='sorted_data_in_json'>
Setting Attributes
Todo
- Add support for not-listed items.
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-06