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