An open API service indexing awesome lists of open source software.

https://github.com/unisharp/dndsort

jquery drop and drag sort plugin
https://github.com/unisharp/dndsort

Last synced: 9 days ago
JSON representation

jquery drop and drag sort plugin

Awesome Lists containing this project

README

          

# dndsort
Help building sorted list items by jQuery.

## Installation

* this plugin requires jQuery and jQuery-UI

## Initialization

* generate list items :

```javascript
$('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

```javascript
$('#new-data').click(function(){
$('#sortable').dndsort('new');
});
```

* generate sorted data

```javascript
$('#submit').click(function(){
$('#sortable').dndsort('save');
});
```

this make input like below :

```html

```

## Setting Attributes

## Todo

* Add support for not-listed items.