ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: EPM Solutions on December 29, 2020, 01:02:49 pm

Title: How to stop drag and drop row in one group to anther group rows
Post by: EPM Solutions 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-
Title: Re: How to stop drag and drop row in one group to anther group rows
Post by: paramvir 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
);
Title: Re: How to stop drag and drop row in one group to anther group rows
Post by: EPM Solutions on January 04, 2021, 02:58:01 pm
Hello Team,

Thanks.