X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/docs/output/Ext.view.DragZone.js diff --git a/docs/output/Ext.view.DragZone.js b/docs/output/Ext.view.DragZone.js new file mode 100644 index 00000000..89115871 --- /dev/null +++ b/docs/output/Ext.view.DragZone.js @@ -0,0 +1 @@ +Ext.data.JsonP.Ext_view_DragZone({"tagname":"class","html":"
Hierarchy
Files
NOTE This is a private utility class for internal use by the framework. Don't rely on its existence.
\nIf true, animates the proxy element back to the position of the handle element used to trigger the drag.
\nDefaults to: true
True to register this container with the Scrollmanager\nfor auto scrolling during drag operations.
\nTrue to register this container with the Scrollmanager\nfor auto scrolling during drag operations.
\nA named drag drop group to which this object belongs. If a group is specified, then this object will only\ninteract with other drag drop objects in the same group.
\nThe CSS class returned to the drag source when drop is allowed.
\nDefaults to: "x-dd-drop-ok"
The CSS class returned to the drag source when drop is not allowed.
\nDefaults to: "x-dd-drop-nodrop"
The color to use when visually highlighting the drag source in the afterRepair\nmethod after a failed drop (defaults to light blue). The color must be a 6 digit hex value, without\na preceding '#'.
\nDefaults to: "c3daf9"
The available property is false until the linked dom element is accessible.
\nThe available property is false until the linked dom element is accessible.
\nBy default the frame is positioned exactly where the drag element is, so\nwe use the cursor offset provided by Ext.dd.DD. Another option that works only if\nyou do not have constraints on the obj is to have the drag frame centered\naround the cursor. Set centerFrame to true for this effect.
\nConfiguration attributes passed into the constructor
\nConfiguration attributes passed into the constructor
\nProvides default constraint padding to \"constrainTo\" elements.
\nProvides default constraint padding to \"constrainTo\" elements.
\nThis property contains the data representing the dragged object. This data is set up by the implementation\nof the getDragData method. It must contain a ddel property, but can contain\nany other data according to the application's needs.
\nThe group defines a logical collection of DragDrop objects that are\nrelated. Instances only get events when interacting with other\nDragDrop object in the same group. This lets us define multiple\ngroups using a single DragDrop subclass if we want. An object in the format {'group1':true, 'group2':true}
\nBy default, drags can only be initiated if the mousedown occurs in the\nregion the linked element is. This is done in part to work around a\nbug in some browsers that mis-report the mousedown if the previous\nmouseup happened outside of the window. This property is set to true\nif outer handles are defined. Defaults to false.
\nThe id of the element associated with this object. This is what we\nrefer to as the \"linked element\" because the size and position of\nthis element is used to determine when the drag and drop objects have\ninteracted.
\nSet to false to enable a DragDrop object to fire drag events while dragging\nover its own Element. Defaults to true - DragDrop objects do not by default\nfire drag events to themselves.
\nAn Array of CSS class names for elements to be considered in valid as drag handles.
\nAn Array of CSS class names for elements to be considered in valid as drag handles.
\nAn object who's property names identify the IDs of elements to be considered invalid as drag handles.\nA non-null property value identifies the ID as invalid. For example, to prevent\ndragging from being initiated on element ID \"foo\", use:
\n\n{\n foo: true\n}
\n\nAn object who's property names identify HTML tags to be considered invalid as drag handles.\nA non-null property value identifies the tag as invalid. Defaults to the\nfollowing value which prevents drag operations from being initiated by <a> elements:
\n\n{\n A: \"A\"\n}
\n\nBy default, all instances can be a drop target. This can be disabled by\nsetting isTarget to false.
\nMaintain offsets when we resetconstraints. Set to true when you want\nthe position of the element relative to its parent to stay the same\nwhen the page changes
\nWhen set to true, other DD objects in cooperating DDGroups do not receive\nnotification events when this DD object is dragged over them. Defaults to false.
\nThe padding configured for this drag and drop object for calculating\nthe drop zone intersection with this object.\nAn array containing the 4 padding values: [top, right, bottom, left]
\nBy default the drag and drop instance will only respond to the primary\nbutton click (left button for a right-handed mouse). Set to true to\nallow drag and drop to start with any mouse click that is propogated\nby the browser
\nBy default we resize the drag frame to be the same size as the element\nwe want to drag (this is to get the frame effect). We can turn it off\nif we want a different behavior.
\nWhen set to true, the utility automatically tries to scroll the browser\nwindow when a drag and drop element is dragged near the viewport boundary.\nDefaults to true.
\nGet the reference to the current class from which this object was instantiated. Unlike statics,\nthis.self
is scope-dependent and it's meant to be used for dynamic inheritance. See statics\nfor a detailed comparison
Ext.define('My.Cat', {\n statics: {\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n alert(this.self.speciesName); / dependent on 'this'\n\n return this;\n },\n\n clone: function() {\n return new this.self();\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat'\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\n
\nCreates new DragZone.
\nThe container element or ID of it.
\nLets you specify a css class of elements that will not initiate a drag
\nthe class of the elements you wish to ignore
\nLets you to specify an element id for a child of a drag handle\nthat should not initiate a drag
\nthe element id of the element you wish to ignore
\nAllows you to specify a tag name that should not start a drag operation\nwhen clicked. This is designed to facilitate embedding links within a\ndrag handle that do something other than start the drag.
\nthe type of element to exclude
\nAdds this instance to a group of related drag/drop objects. All\ninstances belong to at least one group, and can belong to as many\ngroups as needed.
\nthe name of the group
\nAn empty function by default, but provided so that you can perform a custom action\nafter a valid drag drop has occurred by providing an implementation.
\nThe drop target
\nThe event object
\nThe id of the dropped element
\nAn empty function by default, but provided so that you can perform a custom action\nwhen the dragged item enters the drop target by providing an implementation.
\nThe drop target
\nThe event object
\nThe id of the dragged element
\nAn empty function by default, but provided so that you can perform a custom action\nafter the dragged item is dragged out of the target without dropping.
\nThe drop target
\nThe event object
\nThe id of the dragged element
\nAn empty function by default, but provided so that you can perform a custom action\nwhile the dragged item is over the drop target by providing an implementation.
\nThe drop target
\nThe event object
\nThe id of the dragged element
\nAn empty function by default, but provided so that you can perform a custom action\nafter an invalid drop has occurred by providing an implementation.
\nThe event object
\nThe id of the dropped element
\nCalled after a repair of an invalid drop. By default, highlights this.dragData.ddel
\nSets the element to the location of the mousedown or click event,\nmaintaining the cursor location relative to the location on the element\nthat was clicked. Override this if you want to place the element in a\nlocation other than where the cursor is.
\nSets up config options specific to this class. Overrides\nExt.dd.DragDrop, but all versions of this method through the\ninheritance chain are called
\nEvent that fires prior to the onMouseDown event. Overrides\nExt.dd.DragDrop.
\nAn empty function by default, but provided so that you can perform a custom action before the dragged\nitem is dropped onto the target and optionally cancel the onDragDrop.
\nThe drop target
\nThe event object
\nThe id of the dragged element
\nisValid True if the drag drop event is valid, else false to cancel
\nAn empty function by default, but provided so that you can perform a custom action\nbefore the dragged item enters the drop target and optionally cancel the onDragEnter.
\nThe drop target
\nThe event object
\nThe id of the dragged element
\nisValid True if the drag event is valid, else false to cancel
\nAn empty function by default, but provided so that you can perform a custom action before the dragged\nitem is dragged out of the target without dropping, and optionally cancel the onDragOut.
\nThe drop target
\nThe event object
\nThe id of the dragged element
\nisValid True if the drag event is valid, else false to cancel
\nAn empty function by default, but provided so that you can perform a custom action\nwhile the dragged item is over the drop target and optionally cancel the onDragOver.
\nThe drop target
\nThe event object
\nThe id of the dragged element
\nisValid True if the drag event is valid, else false to cancel
\nAn empty function by default, but provided so that you can perform a custom action after an invalid\ndrop has occurred.
\nThe drop target
\nThe event object
\nThe id of the dragged element
\nisValid True if the invalid drop should proceed, else false to cancel
\nSaves the most recent position so that we can reset the constraints and\ntick marks on-demand. We need to know this so that we can calculate the\nnumber of pixels the element is offset from its original position.
\nCall the original method that was previously overridden with override
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n\n return this;\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n var instance = this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n\n return instance;\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\nThe arguments, either an array or the arguments
object
Returns the result after calling the overridden method
\nCall the parent's overridden method. For example:
\n\nExt.define('My.own.A', {\n constructor: function(test) {\n alert(test);\n }\n});\n\nExt.define('My.own.B', {\n extend: 'My.own.A',\n\n constructor: function(test) {\n alert(test);\n\n this.callParent([test + 1]);\n }\n});\n\nExt.define('My.own.C', {\n extend: 'My.own.B',\n\n constructor: function() {\n alert(\"Going to call parent's overriden constructor...\");\n\n this.callParent(arguments);\n }\n});\n\nvar a = new My.own.A(1); // alerts '1'\nvar b = new My.own.B(1); // alerts '1', then alerts '2'\nvar c = new My.own.C(2); // alerts \"Going to call parent's overriden constructor...\"\n // alerts '2', then alerts '3'\n
\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callParent(arguments)
Returns the result from the superclass' method
\nClears any constraints applied to this instance. Also clears ticks\nsince they can't exist independent of a constraint at this time.
\nClears any tick interval defined for this instance
\nInitializes the drag drop object's constraints to restrict movement to a certain element.
\n\nUsage:
\n\nvar dd = new Ext.dd.DDProxy(\"dragDiv1\", \"proxytest\",\n { dragElId: \"existingProxyDiv\" });\ndd.startDrag = function(){\n this.constrainTo(\"parent-id\");\n};\n
\n\nOr you can initalize it using the Ext.Element object:
\n\nExt.get(\"dragDiv1\").initDDProxy(\"proxytest\", {dragElId: \"existingProxyDiv\"}, {\n startDrag : function(){\n this.constrainTo(\"parent-id\");\n }\n});\n
\nThe element or element ID to constrain to.
\nPad provides a way to specify \"padding\" of the constraints,\nand can be either a number for symmetrical padding (4 would be equal to {left:4, right:4, top:4, bottom:4}
) or\nan object containing the sides to pad. For example: {right:10, bottom:10}
Constrain the draggable in the content box of the element (inside padding and borders)
\nCreates the proxy element if it does not yet exist
\nCalled when we are done dragging the object
\nthe mouseup event
\nCalled when a mousedown occurs in this container. Looks in Ext.dd.Registry\nfor a valid target to drag based on the mouse down. Override this method\nto provide your own lookup logic (e.g. finding a child by class name). Make sure your returned\nobject has a \"ddel\" attribute (with an HTML Element) for other functions to work.
\nThe mouse down event
\nThe dragData
\nReturns a reference to the actual element to drag. By default this is\nthe same as the html element, but it can be assigned to another\nelement. An example of this can be found in Ext.dd.DDProxy
\nthe html element
\nReturns a reference to the linked element
\nthe html element
\nReturns the drag source's underlying Ext.dd.StatusProxy
\nproxy The StatusProxy
\nCalled before a repair of an invalid drop to get the XY to animate to. By default returns\nthe XY of this.dragData.ddel
\nThe mouse up event
\nThe xy location (e.g. [100, 200])
\nHides the drag source's Ext.dd.StatusProxy
\nSets up the DragDrop object. Must be called in the constructor of any\nExt.dd.DragDrop subclass
\nInitialize configuration for this class. a typical example:
\n\nExt.define('My.awesome.Class', {\n // The default config\n config: {\n name: 'Awesome',\n isAwesome: true\n },\n\n constructor: function(config) {\n this.initConfig(config);\n\n return this;\n }\n});\n\nvar awesome = new My.awesome.Class({\n name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\nmixins The mixin prototypes as key - value pairs
\nInitialization for the drag frame element. Must be called in the\nconstructor of all subclasses
\nReturns true if this instance is locked, or the drag drop mgr is locked\n(meaning that all drag/drop is disabled on the page.)
\ntrue if this obj or all drag/drop is locked, else\nfalse
\nChecks the tag exclusion list to see if this click should be ignored
\nthe HTMLElement to evaluate
\ntrue if this is a valid tag type, false if not
\nOverride the onAvailable method to do what is needed after the initial\nposition was determined.
\nAn empty function by default, but provided so that you can perform a custom action before the initial\ndrag event begins and optionally cancel it.
\nAn object containing arbitrary data to be shared with drop targets
\nThe event object
\nisValid True if the drag event is valid, else false to cancel
\nAbstract method called during the onMouseMove event while dragging an\nobject.
\nthe mousemove event
\nAbstract method called when this item is dropped on another DragDrop\nobj
\nthe mouseup event
\nIn POINT mode, the element\nid this was dropped on. In INTERSECT mode, an array of dd items this\nwas dropped on.
\nAbstract method called when this element fist begins hovering over\nanother DragDrop obj
\nthe mousemove event
\nIn POINT mode, the element\nid this is hovering over. In INTERSECT mode, an array of one or more\ndragdrop items being hovered over.
\nAbstract method called when we are no longer hovering over an element
\nthe mousemove event
\nIn POINT mode, the element\nid this was hovering over. In INTERSECT mode, an array of dd items\nthat the mouse is no longer over.
\nAbstract method called when this element is hovering over another\nDragDrop obj
\nthe mousemove event
\nIn POINT mode, the element\nid this is hovering over. In INTERSECT mode, an array of dd items\nbeing hovered over.
\nCalled once drag threshold has been reached to initialize the proxy element. By default, it clones the\nthis.dragData.ddel
\nThe x position of the click on the dragged object
\nThe y position of the click on the dragged object
\ntrue to continue the drag, false to cancel
\nAbstract method called when this item is dropped on an area with no\ndrop target
\nthe mouseup event
\nCalled when a drag/drop obj gets a mousedown
\nthe mousedown event
\nCalled when a drag/drop obj gets a mouseup
\nthe mouseup event
\nAn empty function by default, but provided so that you can perform a custom action once the initial\ndrag event has begun. The drag cannot be canceled from this function.
\nRemoves this instance from the supplied interaction group
\nThe group to drop
\nUnsets an invalid css class
\nthe class of the element(s) you wish to\nre-enable
\nUnsets an excluded tag name set by addInvalidHandleType
\nthe type of element to unexclude
\nAllows you to specify that an element other than the linked element\nwill be moved with the cursor during a drag
\nthe id of the element that will be used to initiate the drag
\nSets the drag element to the location of the mousedown or click event,\nmaintaining the cursor location relative to the location on the element\nthat was clicked. Override this if you want to place the element in a\nlocation other than where the cursor is.
\nAllows you to specify a child of the linked element that should be\nused to initiate the drag operation. An example of this would be if\nyou have a content div with text and links. Clicking anywhere in the\ncontent area would normally start the drag operation. Use this method\nto specify that an element inside of the content div is the element\nthat starts the drag operation.
\nthe id of the element that will be used to\ninitiate the drag.
\nAllows you to set an element outside of the linked element as a drag\nhandle
\nthe id of the element that will be used to initiate the drag
\nConfigures the padding for the target zone in px. Effectively expands\n(or reduces) the virtual object size for targeting calculations.\nSupports css-style shorthand; if only one parameter is passed, all sides\nwill have that padding, and if only two are passed, the top and bottom\nwill have the first param, the left and right the second.
\nBy default, the element can be dragged any place on the screen. Use\nthis method to limit the horizontal travel of the element. Pass in\n0,0 for the parameters if you want to lock the drag to the y axis.
\nBy default, the element can be dragged any place on the screen. Set\nthis to limit the vertical travel of the element. Pass in 0,0 for the\nparameters if you want to lock the drag to the x axis.
\nGet the reference to the class from which this object was instantiated. Note that unlike self,\nthis.statics()
is scope-independent and it always returns the class from which it was called, regardless of what\nthis
points to during run-time
Ext.define('My.Cat', {\n statics: {\n totalCreated: 0,\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n var statics = this.statics();\n\n alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to\n // equivalent to: My.Cat.speciesName\n\n alert(this.self.speciesName); // dependent on 'this'\n\n statics.totalCreated++;\n\n return this;\n },\n\n clone: function() {\n var cloned = new this.self; // dependent on 'this'\n\n cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName\n\n return cloned;\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n },\n\n constructor: function() {\n this.callParent();\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'\n\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\nalert(clone.groupName); // alerts 'Cat'\n\nalert(My.Cat.totalCreated); // alerts 3\n
\nRemoves all drag and drop hooks for this element
\nAdd / override static properties of this class.
\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.addStatics({\n someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'\n method1: function() { ... }, // My.cool.Class.method1 = function() { ... };\n method2: function() { ... } // My.cool.Class.method2 = function() { ... };\n});\n
\nthis
\nBorrow another class' members to the prototype of this class.
\n\nExt.define('Bank', {\n money: '$$$',\n printMoney: function() {\n alert('$$$$$$$');\n }\n});\n\nExt.define('Thief', {\n ...\n});\n\nThief.borrow(Bank, ['money', 'printMoney']);\n\nvar steve = new Thief();\n\nalert(steve.money); // alerts '$$$'\nsteve.printMoney(); // alerts '$$$$$$$'\n
\nThe class to borrow members from
\nThe names of the members to borrow
\nthis
\nCreate a new instance of this Class.
\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.create({\n someConfig: true\n});\n
\n\nAll parameters are passed to the constructor of the class.
\nthe created instance.
\nCreate aliases for existing prototype methods. Example:
\n\nExt.define('My.cool.Class', {\n method1: function() { ... },\n method2: function() { ... }\n});\n\nvar test = new My.cool.Class();\n\nMy.cool.Class.createAlias({\n method3: 'method1',\n method4: 'method2'\n});\n\ntest.method3(); // test.method1()\n\nMy.cool.Class.createAlias('method5', 'method3');\n\ntest.method5(); // test.method3() -> test.method1()\n
\nThe new method name, or an object to set multiple aliases. See\nflexSetter
\nThe original method name
\nGet the current class' name in string format.
\n\nExt.define('My.cool.Class', {\n constructor: function() {\n alert(this.self.getName()); // alerts 'My.cool.Class'\n }\n});\n\nMy.cool.Class.getName(); // 'My.cool.Class'\n
\nclassName
\nAdd methods / properties to the prototype of this class.
\n\nExt.define('My.awesome.Cat', {\n constructor: function() {\n ...\n }\n});\n\n My.awesome.Cat.implement({\n meow: function() {\n alert('Meowww...');\n }\n });\n\n var kitty = new My.awesome.Cat;\n kitty.meow();\n
\nOverride prototype members of this class. Overridden methods can be invoked via\ncallOverridden
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n\n return this;\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n var instance = this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n\n return instance;\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\nthis
\n