1 <div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.ux.ToolbarDroppable-props"><img src="resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> <a class="inner-link" href="#Ext.ux.ToolbarDroppable-methods"><img src="resources/images/default/s.gif" class="item-icon icon-method">Methods</a> <a class="inner-link" href="#Ext.ux.ToolbarDroppable-events"><img src="resources/images/default/s.gif" class="item-icon icon-event">Events</a> <a class="bookmark" href="../docs/?class=Ext.ux.ToolbarDroppable"><img src="resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> </div><h1>Class <a href="source/ToolbarDroppable.html#cls-Ext.ux.ToolbarDroppable">Ext.ux.ToolbarDroppable</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.ux</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/ToolbarDroppable.html#cls-Ext.ux.ToolbarDroppable">ToolbarDroppable.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/ToolbarDroppable.html#cls-Ext.ux.ToolbarDroppable">ToolbarDroppable</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr></table><div class="description">Plugin which allows items to be dropped onto a toolbar and be turned into new Toolbar items.
2 To use the plugin, you just need to provide a createItem implementation that takes the drop
3 data as an argument and returns an object that can be placed onto the toolbar. Example:
5 new Ext.ux.ToolbarDroppable({
6 createItem: function(data) {
7 return new Ext.Button({text: data.text});
11 The afterLayout function can also be overridden, and is called after a new item has been
12 created and inserted into the Toolbar. Use this for any logic that needs to be run after
13 the item has been created.</div><div class="hr"></div><a id="Ext.ux.ToolbarDroppable-props"></a><h2>Public Properties</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Property</th><th class="msource-header">Defined By</th></tr><tr class="property-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-afterLayout"></a><b><a href="source/ToolbarDroppable.html#prop-Ext.ux.ToolbarDroppable-afterLayout">afterLayout</a></b> : Object<div class="mdesc">Called after a new button has been created and added to the toolbar. Add any required cleanup logic here</div></td><td class="msource">ToolbarDroppable</td></tr><tr class="property-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-dropTarget"></a><b><a href="source/ToolbarDroppable.html#prop-Ext.ux.ToolbarDroppable-dropTarget">dropTarget</a></b> : Ext.dd.DropTarget
14 The drop target attached to the toolbar instance<div class="mdesc"></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="property-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-toolbar"></a><b><a href="source/ToolbarDroppable.html#prop-Ext.ux.ToolbarDroppable-toolbar">toolbar</a></b> : Ext.Toolbar
15 The toolbar instance that this plugin is tied to<div class="mdesc"></div></td><td class="msource">ToolbarDroppable</td></tr></tbody></table><a id="Ext.ux.ToolbarDroppable-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-addDDGroup"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-addDDGroup">addDDGroup</a></b>( <code>String ddGroup</code> )
17 void<div class="mdesc"><div class="short">Adds the given DD Group to the drop target</div><div class="long">Adds the given DD Group to the drop target<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>ddGroup</code> : String<div class="sub-desc">The DD Group</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-calculateEntryIndex"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-calculateEntryIndex">calculateEntryIndex</a></b>( <code>Ext.EventObject e</code> )
19 Number<div class="mdesc"><div class="short">Calculates the location on the toolbar to create the new sorter button based on the XY of the
20 drag event</div><div class="long">Calculates the location on the toolbar to create the new sorter button based on the XY of the
21 drag event<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>e</code> : Ext.EventObject<div class="sub-desc">The event object</div></li></ul><strong>Returns:</strong><ul><li><code>Number</code><div class="sub-desc">The index at which to insert the new button</div></li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-canDrop"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-canDrop">canDrop</a></b>( <code>Object data</code> )
23 Boolean<div class="mdesc"><div class="short">Returns true if the drop is allowed on the drop target. This function can be overridden
24 and defaults to simply return...</div><div class="long">Returns true if the drop is allowed on the drop target. This function can be overridden
25 and defaults to simply return true<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>data</code> : Object<div class="sub-desc">Arbitrary data from the drag source</div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc">True if the drop is allowed</div></li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-constructor"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-constructor">constructor</a></b>()
27 void<div class="mdesc"><div class="short"></div><div class="long"><div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-createDropTarget"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-createDropTarget">createDropTarget</a></b>()
29 void<div class="mdesc"><div class="short">Creates a drop target on the toolbar</div><div class="long">Creates a drop target on the toolbar<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-createItem"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-createItem">createItem</a></b>( <code>Object data</code> )
31 Mixed<div class="mdesc"><div class="short">Creates the new toolbar item based on drop data. This method must be implemented by the plugin instance</div><div class="long">Creates the new toolbar item based on drop data. This method must be implemented by the plugin instance<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>data</code> : Object<div class="sub-desc">Arbitrary data from the drop</div></li></ul><strong>Returns:</strong><ul><li><code>Mixed</code><div class="sub-desc">An item that can be added to a toolbar</div></li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-init"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-init">init</a></b>( <code>Ext.Toolbar toolbar</code> )
33 void<div class="mdesc"><div class="short">Initializes the plugin and saves a reference to the toolbar</div><div class="long">Initializes the plugin and saves a reference to the toolbar<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>toolbar</code> : Ext.Toolbar<div class="sub-desc">The toolbar instance</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-notifyDrop"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-notifyDrop">notifyDrop</a></b>()
35 void<div class="mdesc"><div class="short">Called when the drop has been made. Creates the new toolbar item, places it at the correct location
36 and calls the aft...</div><div class="long">Called when the drop has been made. Creates the new toolbar item, places it at the correct location
37 and calls the afterLayout callback.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.ToolbarDroppable-notifyOver"></a><b><a href="source/ToolbarDroppable.html#method-Ext.ux.ToolbarDroppable-notifyOver">notifyOver</a></b>()
39 String<div class="mdesc"><div class="short">Custom notifyOver method which will be used in the plugin's internal DropTarget</div><div class="long">Custom notifyOver method which will be used in the plugin's internal DropTarget<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>String</code><div class="sub-desc">The CSS class to add</div></li></ul></div></div></div></td><td class="msource">ToolbarDroppable</td></tr></tbody></table><a id="Ext.ux.ToolbarDroppable-events"></a><h2>Public Events</h2><div class="no-members">This class has no public events.</div></div>