jqGrid drag and drop a copy of the row, rather than moving the row?
It's easy to connect two grids for Drag and Drop开发者_StackOverflow社区:
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?
Use the dragcopy option when setting up the DnD options:
jQuery("#sourceGrid").jqGrid('gridDnD',{connectWith:'#targetGrid', dragcopy: true});
Link to documentation
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*/}}});
精彩评论