View Full Version : Copy function along with Drag n Drop in a GridPanel

24 May 2010, 4:03 AM

I have an Grid and would like to enable Copy using 'Ctrl+C' when a row in the grid is selected.
Along with copy function the Drag n Drop feature needs to be enabled.

Currently, if Drag n Drop is enabled; Copy function does not work
and once the Drag n Drop is disabled; Copy function works fine.

Is there any way to have both the functions working at on the same grid.

To perform copy function I'm using the code found in one of the forum posts.

<!-- Custom Code to allow users to copy Grid data (using mouse and ctrl+c) in IE/Mozilla/Safari-->
<script type="text/javascript">
if (!Ext.grid.GridView.prototype.templates) {
Ext.grid.GridView.prototype.templates = {};
Ext.grid.GridView.prototype.templates.cell = new Ext.Template(
'<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} x-selectable {css}" style="{style}" tabIndex="0" {cellAttr}>',
'<div class="x-grid3-cell-inner x-grid3-col-{id}" {attr}>{value}</div>',

<style type="text/css">
.x-selectable, .x-selectable * {
-moz-user-select: text!important;
-khtml-user-select: text!important;