3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">// private
9 // This is a support class used internally by the Grid components
10 Ext.grid.SplitDragZone = function(grid, hd, hd2){
12 this.view = grid.getView();
13 this.proxy = this.view.resizeProxy;
14 Ext.grid.SplitDragZone.superclass.constructor.call(this, hd,
15 "gridSplitters" + this.grid.getGridEl().id, {
16 dragElId : Ext.id(this.proxy.dom), resizeFrame:false
18 this.setHandleElId(Ext.id(hd));
19 this.setOuterHandleElId(Ext.id(hd2));
22 Ext.extend(Ext.grid.SplitDragZone, Ext.dd.DDProxy, {
25 b4StartDrag : function(x, y){
26 this.view.headersDisabled = true;
27 this.proxy.setHeight(this.view.mainWrap.getHeight());
28 var w = this.cm.getColumnWidth(this.cellIndex);
29 var minw = Math.max(w-this.grid.minColumnWidth, 0);
30 this.resetConstraints();
31 this.setXConstraint(minw, 1000);
32 this.setYConstraint(0, 0);
36 Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y);
40 handleMouseDown : function(e){
41 var ev = Ext.EventObject.setEvent(e);
42 var t = this.fly(ev.getTarget());
43 if(t.hasClass("x-grid-split")){
44 this.cellIndex = this.view.getCellIndex(t.dom);
46 this.cm = this.grid.colModel;
47 if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){
48 Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this, arguments);
53 endDrag : function(e){
54 this.view.headersDisabled = false;
55 var endX = Math.max(this.minX, Ext.lib.Event.getPageX(e));
56 var diff = endX - this.startPos;
57 this.view.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff);
60 autoOffset : function(){