4
Views
4
Comments
Solved
[zTree] Save sort drag and drop Ztree Component
Forge component by Eduardo Luís
20
Published on 03 Oct 2019

Hello guys!

Have you used the Drag and Drop property of the Ztree component?

In my structure I have a property called ORDER, this property will store the order of each parent node in my tree.


[Node 1: ORDER = 1

  Node 2: ORDER = 2

  Node 3: ORDER = 3

  Node 4: ORDER = 4]


After moving any node up or down, I would like to get the node value and thus save that new position value in my ORDER property.

Currently I can already have Drag and Drop. What happens... that is not saving the position.

Do you have any experience of how I can implement with ztree?

cat.png

Rank: #72
Solution

Hi Danilo,

I implemented an example of how to get the element that is being dragged and where it was dropped.

See the attached oml.

Changes were made to the beforeDrop callback settings.



zTreeDragAndDrop.oml

Rank: #14073

I am using the traditional web.

Rank: #72
Solution

Hi Danilo,

I implemented an example of how to get the element that is being dragged and where it was dropped.

See the attached oml.

Changes were made to the beforeDrop callback settings.



zTreeDragAndDrop.oml