|
@@ -245,8 +245,12 @@
|
|
handleDrop(draggingNode, dropNode, dropType, ev) {
|
|
handleDrop(draggingNode, dropNode, dropType, ev) {
|
|
console.log('tree drop: ', dropNode.label, dropType);
|
|
console.log('tree drop: ', dropNode.label, dropType);
|
|
},
|
|
},
|
|
- allowDrop(draggingNode, dropNode) {
|
|
|
|
- return dropNode.data.label !== 'Level two 3-1';
|
|
|
|
|
|
+ allowDrop(draggingNode, dropNode, type) {
|
|
|
|
+ if (dropNode.data.label === 'Level two 3-1') {
|
|
|
|
+ return type !== 'inner';
|
|
|
|
+ } else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
allowDrag(draggingNode) {
|
|
allowDrag(draggingNode) {
|
|
return draggingNode.data.label.indexOf('Level three 3-1-1') === -1;
|
|
return draggingNode.data.label.indexOf('Level three 3-1-1') === -1;
|
|
@@ -1142,8 +1146,12 @@ You can drag and drop Tree nodes by adding a `draggable` attribute.
|
|
handleDrop(draggingNode, dropNode, dropType, ev) {
|
|
handleDrop(draggingNode, dropNode, dropType, ev) {
|
|
console.log('tree drop: ', dropNode.label, dropType);
|
|
console.log('tree drop: ', dropNode.label, dropType);
|
|
},
|
|
},
|
|
- allowDrop(draggingNode, dropNode) {
|
|
|
|
- return dropNode.data.label !== 'Level two 3-1';
|
|
|
|
|
|
+ allowDrop(draggingNode, dropNode, type) {
|
|
|
|
+ if (dropNode.data.label === 'Level two 3-1') {
|
|
|
|
+ return type !== 'inner';
|
|
|
|
+ } else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
allowDrag(draggingNode) {
|
|
allowDrag(draggingNode) {
|
|
return draggingNode.data.label.indexOf('Level three 3-1-1') === -1;
|
|
return draggingNode.data.label.indexOf('Level three 3-1-1') === -1;
|
|
@@ -1177,7 +1185,7 @@ You can drag and drop Tree nodes by adding a `draggable` attribute.
|
|
| indent | Indentación horizontal de los nodos en niveles adyacentes, en pixeles | number | — | 16 |
|
|
| indent | Indentación horizontal de los nodos en niveles adyacentes, en pixeles | number | — | 16 |
|
|
| draggable | si se habilita la función de drag and drop en los nodos | boolean | — | false |
|
|
| draggable | si se habilita la función de drag and drop en los nodos | boolean | — | false |
|
|
| allow-drag | esta función se ejecutará antes de arrastrar un nodo. si devuelve `false`, el nodo no puede ser arrastrado. | Function(nodo) | — | — |
|
|
| allow-drag | esta función se ejecutará antes de arrastrar un nodo. si devuelve `false`, el nodo no puede ser arrastrado. | Function(nodo) | — | — |
|
|
-| allow-drop | esta función se ejecutará al arrastrar y soltar un nodo. si devuelve false, el nodo arrastrando no se puede soltar en el nodo destino. | Function(Nodoquesearrastra, Nododestino) | — | — |
|
|
|
|
|
|
+| allow-drop | esta función se ejecutará al arrastrar y soltar un nodo. si devuelve false, el nodo arrastrando no se puede soltar en el nodo destino. `type` has three possible values: 'prev' (inserting the dragging node before the target node), 'inner' (inserting the dragging node to the target node) and 'next' (inserting the dragging node after the target node) | Function(Nodoquesearrastra, Nododestino, type) | — | — |
|
|
|
|
|
|
### props
|
|
### props
|
|
| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
|
|
| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
|