jQuery EasyUI Extension - TreeGrid Row Drag and Drop (Drag and Drop Rows in TreeGrid)
jQuery EasyUI Extension
Usage
Include the 'treegrid-dnd.js' file
Enable drag and drop
Name
Size
Modified Date
Events
This event extends from the treegrid; below are the events added for the treegrid.
| Name | Parameters | Description |
|---|---|---|
| onBeforeDrag | row | Triggered before the drag of a row starts; returning false cancels the drag. |
| onStartDrag | row | Triggered when a row starts being dragged. |
| onStopDrag | row | Triggered after a row stops being dragged. |
| onDragEnter | targetRow, sourceRow | Triggered when a dragged row enters a target row where dropping is allowed; returning false cancels the drop. |
| onDragOver | targetRow, sourceRow | Triggered when a dragged row is over a target row where dropping is allowed; returning false cancels the drop. |
| onDragLeave | targetRow, sourceRow | Triggered when a dragged row leaves a target row where dropping is allowed. |
| onBeforeDrop | targetRow,sourceRow,point | Triggered before a row is dropped; returning false cancels the drop. |
targetRow:放置的目标行。
sourceRow:拖拽的源行。
point:指示放置的位置,可能的值:'append'、'top' 或 'bottom'。 |
| onDrop | targetRow,sourceRow,point | Triggered when a row is dropped.
targetRow: the target row for the drop.
sourceRow: the source row being dragged.
point: indicates the drop position; possible values: 'append', 'top', or 'bottom'. |
Method
This method extends from the treegrid.
| Name | Parameters | Description |
|---|---|---|
| enableDnd | id | Enable row drag and drop. |
'id' 参数指示要被拖拽与放置的行。
如果该参数未指定,则拖拽与放置所有行。 |
Download the jQuery EasyUI example
jquery-easyui-treegrid-dnd.zip
jQuery EasyUI Extension