react-drag-listview
React drag list component.
install
Example
-
###### Drag Rows
-
###### Drag Columns
Development
npm installnpm start
Usage
const ReactDragListView = ; Component { superprops; const data = ; for let i = 1 len = 7; i < len; i++ data; thisstate = data ; } { const that = this; const dragProps = { const data = thatstatedata; const item = data0; data; that; } nodeSelector: 'li' handleSelector: 'a' ; return <ReactDragListView ...dragProps> <ol> thisstatedata </ol> </ReactDragListView> ; }
API
Properties
Name | Type | Default | Description |
---|---|---|---|
onDragEnd | Function(fromIndex, toIndex) | on drag end callback, required | |
nodeSelector | String | tr | get drag item cssQuery |
handleSelector | String | nodeSelector | get drag handle cssQuery |
enableScroll | Boolean | true | whether use auto scroll for dragging |
scrollSpeed | Number | 10 | scroll speed |
lineClassName | String | get dragLine's className, css properties must be use !important |
License
react-drag-listview is released under the MIT license.