Reputation: 13
It's easy to connect two grids for Drag and Drop:
jQuery("#sourceGrid").jqGrid('gridDnD',{connectWith:'#targetGrid'});
However, this moves the row from source to target. I want to copy the row from source to target.
The default "drag_opt" for gridDnd includes "helper: 'cone'", but it doesn't appear to be cloning. Does anybody have a trivial addition to the above jqGrid that accomplishes copy rather than move?
Upvotes: 1
Views: 2746
Reputation: 85
Use the dragcopy option when setting up the DnD options:
jQuery("#sourceGrid").jqGrid('gridDnD',{connectWith:'#targetGrid', dragcopy: true});
Upvotes: 2
Reputation: 221997
You can try to use
jQuery("#sourceGrid").jqGrid('gridDnD',
{connectWith:'#targetGrid',drag_opts:{stop:null}});
or
jQuery("#sourceGrid").jqGrid('gridDnD',
{connectWith:'#targetGrid',
drag_opts:{stop:function(event,ui) {/*do on drop*/}}});
Upvotes: 1