You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When drag&drop is activated on a p:tree with the dropRestrict = sibling attribute, when we click on a node to move it, it would be interesting to change the color of the drop point if it is a valid drop point or not, that would allow for a more intuitive interaction.
Describe the solution you would like
A solution would be to have a attribute like siblingClass when we can define for example the color of drop point if drag&drop is authorized or not
Example when drag&drop is in same parent node
Example when drag&drop is out of parent node
The text was updated successfully, but these errors were encountered:
This is pretty tricky since PF doesn't evaluate whether the drop is allowed until AFTER you actually drop the node.
/** * After a drag&drop, validates if the drop is allowed. * @private * @param {JQuery} dragNode Node that was dragged. * @param {JQuery} dropPoint Element where the node was dropped. * @return {boolean} Whether the drop is allowed. */validateDropPoint: function(dragNode,dropPoint){//dropped before or afterif(dragNode.next().get(0)===dropPoint.get(0)||dragNode.prev().get(0)===dropPoint.get(0)){returnfalse;}//descendant of dropnodeif(dragNode.has(dropPoint.get(0)).length){returnfalse;}//drop restrictionif(this.cfg.dropRestrict){if(this.cfg.dropRestrict==='sibling'&&dragNode.parent().get(0)!==dropPoint.parent().get(0)){returnfalse;}}returntrue;},
So it will be tough to preemptively tell its not allowed to drop and change the helper css to a different style. At least not without some major rework of the tree drag and drop.
Description
When drag&drop is activated on a p:tree with the dropRestrict = sibling attribute, when we click on a node to move it, it would be interesting to change the color of the drop point if it is a valid drop point or not, that would allow for a more intuitive interaction.
Describe the solution you would like
A solution would be to have a attribute like siblingClass when we can define for example the color of drop point if drag&drop is authorized or not
Example when drag&drop is in same parent node
Example when drag&drop is out of parent node
The text was updated successfully, but these errors were encountered: