Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / source / DropTarget.html
index cc9cc2c..de9cd53 100644 (file)
@@ -1,19 +1,5 @@
-<html>
-<head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
-  <title>The source code</title>
-    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
-    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
-</head>
-<body  onload="prettyPrint();">
-    <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.3.1
- * Copyright(c) 2006-2010 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-<div id="cls-Ext.dd.DropTarget"></div>/**
- * @class Ext.dd.DropTarget
+<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-dd.DropTarget-method-constructor'><span id='Ext-dd.DropTarget'>/**
+</span></span> * @class Ext.dd.DropTarget
  * @extends Ext.dd.DDTarget
  * A simple class that provides the basic implementation needed to make any element a drop target that can have
  * draggable items dropped onto it.  The drop has no effect until an implementation of notifyDrop is provided.
  * @param {Mixed} el The container element
  * @param {Object} config
  */
-Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, {
-    
+Ext.define('Ext.dd.DropTarget', {
+    extend: 'Ext.dd.DDTarget',
+    requires: ['Ext.dd.ScrollManager'],
+
     constructor : function(el, config){
         this.el = Ext.get(el);
-    
+
         Ext.apply(this, config);
-    
+
         if(this.containerScroll){
             Ext.dd.ScrollManager.register(this.el);
         }
-    
-        Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, 
-              {isTarget: true});        
+
+        this.callParent([this.el.dom, this.ddGroup || this.group,
+              {isTarget: true}]);
     },
-    
-    <div id="cfg-Ext.dd.DropTarget-ddGroup"></div>/**
-     * @cfg {String} ddGroup
+
+<span id='Ext-dd.DropTarget-cfg-ddGroup'>    /**
+</span>     * @cfg {String} ddGroup
      * A named drag drop group to which this object belongs.  If a group is specified, then this object will only
      * interact with other drag drop objects in the same group (defaults to undefined).
      */
-    <div id="cfg-Ext.dd.DropTarget-overClass"></div>/**
-     * @cfg {String} overClass
-     * The CSS class applied to the drop target element while the drag source is over it (defaults to "").
+<span id='Ext-dd.DropTarget-cfg-overClass'>    /**
+</span>     * @cfg {String} overClass
+     * The CSS class applied to the drop target element while the drag source is over it (defaults to &quot;&quot;).
      */
-    <div id="cfg-Ext.dd.DropTarget-dropAllowed"></div>/**
-     * @cfg {String} dropAllowed
-     * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok").
+<span id='Ext-dd.DropTarget-cfg-dropAllowed'>    /**
+</span>     * @cfg {String} dropAllowed
+     * The CSS class returned to the drag source when drop is allowed (defaults to &quot;x-dd-drop-ok&quot;).
      */
-    dropAllowed : "x-dd-drop-ok",
-    <div id="cfg-Ext.dd.DropTarget-dropNotAllowed"></div>/**
-     * @cfg {String} dropNotAllowed
-     * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop").
+    dropAllowed : Ext.baseCSSPrefix + 'dd-drop-ok',
+<span id='Ext-dd.DropTarget-cfg-dropNotAllowed'>    /**
+</span>     * @cfg {String} dropNotAllowed
+     * The CSS class returned to the drag source when drop is not allowed (defaults to &quot;x-dd-drop-nodrop&quot;).
      */
-    dropNotAllowed : "x-dd-drop-nodrop",
+    dropNotAllowed : Ext.baseCSSPrefix + 'dd-drop-nodrop',
 
     // private
     isTarget : true,
@@ -62,8 +50,8 @@ Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, {
     // private
     isNotifyTarget : true,
 
-    <div id="method-Ext.dd.DropTarget-notifyEnter"></div>/**
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source is now over the
+<span id='Ext-dd.DropTarget-method-notifyEnter'>    /**
+</span>     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source is now over the
      * target.  This default implementation adds the CSS class specified by overClass (if any) to the drop element
      * and returns the dropAllowed config value.  This method should be overridden if drop validation is required.
      * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target
@@ -74,13 +62,13 @@ Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, {
      */
     notifyEnter : function(dd, e, data){
         if(this.overClass){
-            this.el.addClass(this.overClass);
+            this.el.addCls(this.overClass);
         }
         return this.dropAllowed;
     },
 
-    <div id="method-Ext.dd.DropTarget-notifyOver"></div>/**
-     * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the target.
+<span id='Ext-dd.DropTarget-method-notifyOver'>    /**
+</span>     * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the target.
      * This method will be called on every mouse movement while the drag source is over the drop target.
      * This default implementation simply returns the dropAllowed config value.
      * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target
@@ -93,8 +81,8 @@ Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, {
         return this.dropAllowed;
     },
 
-    <div id="method-Ext.dd.DropTarget-notifyOut"></div>/**
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source has been dragged
+<span id='Ext-dd.DropTarget-method-notifyOut'>    /**
+</span>     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source has been dragged
      * out of the target without dropping.  This default implementation simply removes the CSS class specified by
      * overClass (if any) from the drop element.
      * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target
@@ -103,30 +91,29 @@ Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, {
      */
     notifyOut : function(dd, e, data){
         if(this.overClass){
-            this.el.removeClass(this.overClass);
+            this.el.removeCls(this.overClass);
         }
     },
 
-    <div id="method-Ext.dd.DropTarget-notifyDrop"></div>/**
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the dragged item has
+<span id='Ext-dd.DropTarget-method-notifyDrop'>    /**
+</span>     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the dragged item has
      * been dropped on it.  This method has no default implementation and returns false, so you must provide an
      * implementation that does something to process the drop event and returns true so that the drag source's
      * repair action does not run.
      * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target
      * @param {Event} e The event
      * @param {Object} data An object containing arbitrary data supplied by the drag source
-     * @return {Boolean} True if the drop was valid, else false
+     * @return {Boolean} False if the drop was invalid.
      */
     notifyDrop : function(dd, e, data){
         return false;
     },
-    
+
     destroy : function(){
-        Ext.dd.DropTarget.superclass.destroy.call(this);
+        this.callParent();
         if(this.containerScroll){
             Ext.dd.ScrollManager.unregister(this.el);
         }
     }
-});</pre>    
-</body>
-</html>
\ No newline at end of file
+});
+</pre></pre></body></html>
\ No newline at end of file