primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Setting Droppable: false to TreeNode doesn't disable its DropPoints

Open ghost opened this issue 9 years ago • 4 comments

[x ] bug report

Current behavior When droppableNodes="true", Nodes can be dropped on all DropPoints, even when the 'droppable' property of the DropPoints' parent Nodes is set to 'false'.

  • PrimeNG version: 4.0.3

ghost avatar Jun 01 '17 12:06 ghost

I feel like it is expected, it is not dropping onto the node, droppoints are still useful to change order within tree. If more users demand it, we'll reopen, thank you.

cagataycivici avatar Jun 29 '17 09:06 cagataycivici

To clarify, the problem is that ALL droppoints are enabled, which means a node may be dropped into droppoints of different levels, hence changing their parent, and not just their order.

ghost avatar Aug 02 '17 11:08 ghost

@cagataycivici, I have the same issue. For an example, If 'node A' contains two children 'node A1' and 'node A2' and 'node A's droppable property is set false, then I need to disable all the drop points belong to 'node A' not 'node A1' and 'nodeA2'. Is there anyway I can achieve this?

akila89 avatar Sep 05 '17 12:09 akila89

I use PrimeNG 5.0.2 and am trying to limit where nodes can be dropped. I use a custom template to enable dropping (droppable=true) using the onDragStart method, and disabling dropping (droppable=false) on onDragEnd.

The onDragStart contains the logic to determine what allowed nodes (and 'reorder' locations) are.

Due to the droppoint behaviour I cannot make it work. Even when I set droppable=false on a node, the dragged node can still be dropped on a droppoint below that node, hence 'bypassing' my logic.

I have not found a way to influence to enable/disable 'droppable' on droppoints.

So 2 questions:

  1. is there a way to influence droppoint droppable behaviour and
  2. can you reconsider reopening this bug

PS: Thanks for the great set of components )

quartelh avatar Oct 29 '18 20:10 quartelh