Search code examples
javascriptextjsdrag-and-dropextjs3treenode

Enable drag and drop of nodes only within the same parent


I have an ExtJs (3.4) tree with multiple nodes, each nodes have multiples children. I would like to allow drag and drop within each parents and I want to disable drag and drop of children of one parent to other parents.

Is there an easy and elegant way to do it ? Otherwise, I am thinking of using onNodeDrop and onNodeOver events.

Thank you


Solution

  • Use jQuery-ui .sortable() http://jqueryui.com/sortable/

    Calling .sortable() without connecting lists will allow you to sort items only within their parent.