4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-grid-header-DragZone'>/**
19 </span> * @class Ext.grid.header.DragZone
20 * @extends Ext.dd.DragZone
23 Ext.define('Ext.grid.header.DragZone', {
24 extend: 'Ext.dd.DragZone',
25 colHeaderCls: Ext.baseCSSPrefix + 'column-header',
28 constructor: function(headerCt) {
29 this.headerCt = headerCt;
30 this.ddGroup = this.getDDGroup();
31 this.callParent([headerCt.el]);
32 this.proxy.el.addCls(Ext.baseCSSPrefix + 'grid-col-dd');
35 getDDGroup: function() {
36 return 'header-dd-zone-' + this.headerCt.up('[scrollerOwner]').id;
39 getDragData: function(e) {
40 var header = e.getTarget('.'+this.colHeaderCls),
44 headerCmp = Ext.getCmp(header.id);
45 if (!this.headerCt.dragging && headerCmp.draggable && !(headerCmp.isOnLeftEdge(e) || headerCmp.isOnRightEdge(e))) {
46 var ddel = document.createElement('div');
47 ddel.innerHTML = Ext.getCmp(header.id).text;
57 onBeforeDrag: function() {
58 return !(this.headerCt.dragging || this.disabled);
61 onInitDrag: function() {
62 this.headerCt.dragging = true;
63 this.callParent(arguments);
66 onDragDrop: function() {
67 this.headerCt.dragging = false;
68 this.callParent(arguments);
71 afterRepair: function() {
73 this.headerCt.dragging = false;
76 getRepairXY: function() {
77 return this.dragData.header.el.getXY();
85 this.disabled = false;