Treeview multiselectable and drag and drop issue

Hi

Please help  me.

When i select more one item on treeview and then i drag and drop to another treeview component, İ just dedect one item by nodeDropped listener. But how can i dedect all item. 

Thanks


1 Reply

SM Shalini Maragathavel Syncfusion Team November 16, 2021 12:33 PM UTC

Hi Yahya, 

Greetings from Syncfusion support. 

We checked your query and would like to let you know that the drag and drop events work based on mouse pointer. You can get the selected node using selectedNodes property and the selected node details using getNode method in nodeDragStart event of TreeView as demonstrated in the below code snippet, 
export class Dragdrop extends SampleBase { 
  nodeDragStart(args) { 
    var selectedNodes = this.selectedNodes; //to get the selected nodes id 
    for (var i = 0; i < selectedNodes.length; i++) { 
      console.log(this.getNode(selectedNodes[i])); //to get the selected node details 
    } 
  } 

  render() { 
    return ( 
                <TreeViewComponent 
                  id="tree1" 
                  fields={this.field} 
                  nodeDragStart={this.nodeDragStart} 
                  allowMultiSelection={true} 
                  allowDragAndDrop={this.allowDragAndDrop} 
                /> 
              </div> 
)} 

Note: If you need to get the complete details of selected node, we suggest you to use the getTreeData method of TreeView.

Please get back to us if you need further assistance.

Regards,   
Shalini M. 


Loader.
Up arrow icon