Drag 'n' Drop, Multilevel Problem

Hi,

I’m using Version Pro v2.5.

When I want to drag multiple nodes from a Tree, I can only select nodes form the same level.
If I want to multi-select child nodes of a particular node (let’s say X) I can but soon as I want also to select ‘X’ in my multiselection, only ‘X’ remains in the nodes I can Drag.

Is there a solution for this problem ?

Thanks in advance.

Hi,

you use strict multiselection
tree.enableMultiselection(true,true);

Try to pass only one parameter to the enableMultiselection method - any items can be selected:

tree.enableMultiselection(true);

Thanks for your quick response.

I’m already using enableMultiselection(true).
The problem is not the multiselection itself, it’s when I drag the selected items it’s only draging the parent node and not the childs.

Can we reproduce the problem in the samples from tree package ?

Please provide the demo (do not include the dhtmlx libraries) and inctructions how to recreate the problem locally.

Yes it can be reproduced with the samples just by adding tree.enableMultiselection(true);

Example 03_pro_drag_complex.html, Line 66
tree.enableSmartXMLParsing(true);
tree.enableMultiselection(true);

  1. Select “History” and some of its childs.
  2. Drag the all selection
  3. Only History will be drag

In a way it’s a normal behaviour for a tree because the parent “History” is regrouping all the childs (“Jim Dwyer”, “John Mack Faragher” , …) but in our projects, a parent or a child have the same “type”. We only need to drag the labels associated to the element in the tree.
So in the above example, I would like to drag the labels: “History”, “Jim Dwyer”, “John Mack Faragher” whether or not they are parent or child.

I hope it’s clear … somehow .

Thanks

Technically, you can disable such logic, by using

tree._checkMSelectionLogic = function(){};

But it may break native drop functionality.

Thanks, I will try that.