3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
16 // This is a support class used internally by the Grid components
17 Ext.grid.SplitDragZone = Ext.extend(Ext.dd.DDProxy, {
20 constructor : function(grid, hd, hd2){
22 this.view = grid.getView();
23 this.proxy = this.view.resizeProxy;
24 Ext.grid.SplitDragZone.superclass.constructor.call(this, hd,
25 "gridSplitters" + this.grid.getGridEl().id, {
26 dragElId : Ext.id(this.proxy.dom), resizeFrame:false
28 this.setHandleElId(Ext.id(hd));
29 this.setOuterHandleElId(Ext.id(hd2));
33 b4StartDrag : function(x, y){
34 this.view.headersDisabled = true;
35 this.proxy.setHeight(this.view.mainWrap.getHeight());
36 var w = this.cm.getColumnWidth(this.cellIndex);
37 var minw = Math.max(w-this.grid.minColumnWidth, 0);
38 this.resetConstraints();
39 this.setXConstraint(minw, 1000);
40 this.setYConstraint(0, 0);
44 Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y);
48 handleMouseDown : function(e){
49 var ev = Ext.EventObject.setEvent(e);
50 var t = this.fly(ev.getTarget());
51 if(t.hasClass("x-grid-split")){
52 this.cellIndex = this.view.getCellIndex(t.dom);
54 this.cm = this.grid.colModel;
55 if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){
56 Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this, arguments);
61 endDrag : function(e){
62 this.view.headersDisabled = false;
63 var endX = Math.max(this.minX, Ext.lib.Event.getPageX(e));
64 var diff = endX - this.startPos;
65 this.view.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff);
68 autoOffset : function(){