Author Topic: How to stop drag and drop row in one group to anther group rows  (Read 1679 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
How to stop drag and drop row in one group to anther group rows
« on: December 29, 2020, 01:02:49 pm »
Hello Team,

Thanks,

As we require how to stop drag and drop group rows one group to another group rows.

We need only same group we can drag and drop rows.

Please provide some example code or snippet of code.

Please find the below attached screenshots-
« Last Edit: December 29, 2020, 01:08:09 pm by EPM Solutions »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: How to stop drag and drop row in one group to anther group rows
« Reply #1 on: December 29, 2020, 05:18:24 pm »
you don't want dragged and dropped upon rows to have different parents, so you can add this condition to denyDrop in dropModel.isDroppable callback in this example: https://paramquery.com/pro/demos/dnd_group

Code: [Select]
denyDrop = (
    !rdDrop ||
    rdDrop.pq_gsummary ||
    (rdDrop.pq_gtitle && rdDrop.pq_level < GMDi.length - 1 ) ||
    this.Group().isAncestor( rdDrop,  rdDrag) ||
    (this.Group().getParent( rdDrop) != this.Group().getParent( rdDrag )) || //prevent drop on others' parents.
    rdDrag == rdDrop
);
« Last Edit: December 29, 2020, 05:20:17 pm by paramvir »

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: How to stop drag and drop row in one group to anther group rows
« Reply #2 on: January 04, 2021, 02:58:01 pm »
Hello Team,

Thanks.