+++ /dev/null
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.grid.GridDragZone\r
- * @extends Ext.dd.DragZone\r
- * <p>A customized implementation of a {@link Ext.dd.DragZone DragZone} which provides default implementations of two of the\r
- * template methods of DragZone to enable dragging of the selected rows of a GridPanel.</p>\r
- * <p>A cooperating {@link Ext.dd.DropZone DropZone} must be created who's template method implementations of\r
- * {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver},\r
- * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop}</p> are able\r
- * to process the {@link #getDragData data} which is provided.\r
- */\r
-Ext.grid.GridDragZone = function(grid, config){\r
- this.view = grid.getView();\r
- Ext.grid.GridDragZone.superclass.constructor.call(this, this.view.mainBody.dom, config);\r
- if(this.view.lockedBody){\r
- this.setHandleElId(Ext.id(this.view.mainBody.dom));\r
- this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom));\r
- }\r
- this.scroll = false;\r
- this.grid = grid;\r
- this.ddel = document.createElement('div');\r
- this.ddel.className = 'x-grid-dd-wrap';\r
-};\r
-\r
-Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {\r
- ddGroup : "GridDD",\r
-\r
- /**\r
- * <p>The provided implementation of the getDragData method which collects the data to be dragged from the GridPanel on mousedown.</p>\r
- * <p>This data is available for processing in the {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver},\r
- * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop} methods of a cooperating {@link Ext.dd.DropZone DropZone}.</p>\r
- * <p>The data object contains the following properties:<ul>\r
- * <li><b>grid</b> : Ext.Grid.GridPanel<div class="sub-desc">The GridPanel from which the data is being dragged.</div></li>\r
- * <li><b>ddel</b> : htmlElement<div class="sub-desc">An htmlElement which provides the "picture" of the data being dragged.</div></li>\r
- * <li><b>rowIndex</b> : Number<div class="sub-desc">The index of the row which receieved the mousedown gesture which triggered the drag.</div></li>\r
- * <li><b>selections</b> : Array<div class="sub-desc">An Array of the selected Records which are being dragged from the GridPanel.</div></li>\r
- * </ul></p>\r
- */\r
- getDragData : function(e){\r
- var t = Ext.lib.Event.getTarget(e);\r
- var rowIndex = this.view.findRowIndex(t);\r
- if(rowIndex !== false){\r
- var sm = this.grid.selModel;\r
- if(!sm.isSelected(rowIndex) || e.hasModifier()){\r
- sm.handleMouseDown(this.grid, rowIndex, e);\r
- }\r
- return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()};\r
- }\r
- return false;\r
- },\r
-\r
- /**\r
- * <p>The provided implementation of the onInitDrag method. Sets the <tt>innerHTML</tt> of the drag proxy which provides the "picture"\r
- * of the data being dragged.</p>\r
- * <p>The <tt>innerHTML</tt> data is found by calling the owning GridPanel's {@link Ext.grid.GridPanel#getDragDropText getDragDropText}.</p>\r
- */\r
- onInitDrag : function(e){\r
- var data = this.dragData;\r
- this.ddel.innerHTML = this.grid.getDragDropText();\r
- this.proxy.update(this.ddel);\r
- // fire start drag?\r
- },\r
-\r
- /**\r
- * An empty immplementation. Implement this to provide behaviour after a repair of an invalid drop. An implementation might highlight\r
- * the selected rows to show that they have not been dragged.\r
- */\r
- afterRepair : function(){\r
- this.dragging = false;\r
- },\r
-\r
- /**\r
- * <p>An empty implementation. Implement this to provide coordinates for the drag proxy to slide back to after an invalid drop.</p>\r
- * <p>Called before a repair of an invalid drop to get the XY to animate to.</p>\r
- * @param {EventObject} e The mouse up event\r
- * @return {Array} The xy location (e.g. [100, 200])\r
- */\r
- getRepairXY : function(e, data){\r
- return false;\r
- },\r
-\r
- onEndDrag : function(data, e){\r
- // fire end drag?\r
- },\r
-\r
- onValidDrop : function(dd, e, id){\r
- // fire drag drop?\r
- this.hideProxy();\r
- },\r
-\r
- beforeInvalidDrop : function(e, id){\r
-\r
- }\r
-});\r