Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  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>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. // private
  16. // This is a support class used internally by the Grid components
  17. Ext.grid.SplitDragZone = Ext.extend(Ext.dd.DDProxy, {
  18. fly: Ext.Element.fly,
  19. constructor : function(grid, hd, hd2){
  20. this.grid = grid;
  21. this.view = grid.getView();
  22. this.proxy = this.view.resizeProxy;
  23. Ext.grid.SplitDragZone.superclass.constructor.call(this, hd,
  24. "gridSplitters" + this.grid.getGridEl().id, {
  25. dragElId : Ext.id(this.proxy.dom), resizeFrame:false
  26. });
  27. this.setHandleElId(Ext.id(hd));
  28. this.setOuterHandleElId(Ext.id(hd2));
  29. this.scroll = false;
  30. },
  31. b4StartDrag : function(x, y){
  32. this.view.headersDisabled = true;
  33. this.proxy.setHeight(this.view.mainWrap.getHeight());
  34. var w = this.cm.getColumnWidth(this.cellIndex);
  35. var minw = Math.max(w-this.grid.minColumnWidth, 0);
  36. this.resetConstraints();
  37. this.setXConstraint(minw, 1000);
  38. this.setYConstraint(0, 0);
  39. this.minX = x - minw;
  40. this.maxX = x + 1000;
  41. this.startPos = x;
  42. Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y);
  43. },
  44. handleMouseDown : function(e){
  45. var ev = Ext.EventObject.setEvent(e);
  46. var t = this.fly(ev.getTarget());
  47. if(t.hasClass("x-grid-split")){
  48. this.cellIndex = this.view.getCellIndex(t.dom);
  49. this.split = t.dom;
  50. this.cm = this.grid.colModel;
  51. if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){
  52. Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this, arguments);
  53. }
  54. }
  55. },
  56. endDrag : function(e){
  57. this.view.headersDisabled = false;
  58. var endX = Math.max(this.minX, Ext.lib.Event.getPageX(e));
  59. var diff = endX - this.startPos;
  60. this.view.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff);
  61. },
  62. autoOffset : function(){
  63. this.setDelta(0,0);
  64. }
  65. });</pre>
  66. </body>
  67. </html>