03e1a64835b53dd0a7ae004b509c7a9afb9ba94e.svn-base 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Ext JS Library 2.0 Copyright(c) 2006-2007, Ext JS, LLC. licensing@extjs.com
  3. *
  4. * http://extjs.com/license
  5. */
  6. Ext.grid.GridDragZone = function(B, A) {
  7. this.view = B.getView();
  8. Ext.grid.GridDragZone.superclass.constructor.call(this,
  9. this.view.mainBody.dom, A);
  10. if (this.view.lockedBody) {
  11. this.setHandleElId(Ext.id(this.view.mainBody.dom));
  12. this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom))
  13. }
  14. this.scroll = false;
  15. this.grid = B;
  16. this.ddel = document.createElement("div");
  17. this.ddel.className = "x-grid-dd-wrap"
  18. };
  19. Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {
  20. ddGroup : "GridDD",
  21. getDragData : function(B) {
  22. var A = Ext.lib.Event.getTarget(B);
  23. var D = this.view.findRowIndex(A);
  24. if (D !== false) {
  25. var C = this.grid.selModel;
  26. if (!C.isSelected(D) || B.hasModifier()) {
  27. C.handleMouseDown(this.grid, D, B)
  28. }
  29. return {
  30. grid : this.grid,
  31. ddel : this.ddel,
  32. rowIndex : D,
  33. selections : C.getSelections()
  34. }
  35. }
  36. return false
  37. },
  38. onInitDrag : function(B) {
  39. var A = this.dragData;
  40. this.ddel.innerHTML = this.grid.getDragDropText();
  41. this.proxy.update(this.ddel)
  42. },
  43. afterRepair : function() {
  44. this.dragging = false
  45. },
  46. getRepairXY : function(B, A) {
  47. return false
  48. },
  49. onEndDrag : function(A, B) {
  50. },
  51. onValidDrop : function(A, B, C) {
  52. this.hideProxy()
  53. },
  54. beforeInvalidDrop : function(A, B) {
  55. }
  56. });