Properties Methods Events Config Options Direct Link

# Class Ext.ux.Reorderer

Package: | Ext.ux
Defined In: | Reorderer.js
Class: | Reorderer
Subclasses: | HBoxReorderer, ToolbarReorderer
Extends: | Object

Generic base class for handling reordering of items. This base class must be extended to provide the actual reordering functionality - the base class just sets up events and abstract logic functions. It will fire events and set defaults, deferring the actual reordering to a doReorder implementation. See Ext.ux.TabReorderer for an example.

## Config Options

Config Options | Defined By
--- | ---
| : animate | Reorderer
| : animationDuration | Reorderer
| : defaultReorderable | Reorderer

## Public Properties

Property | Defined By
--- | ---
| defaults : Object Object containing default values for plugin configuration details. These can be overridden when constructing the plugin | Reorderer
| target : Ext.Component Reference to the target component which contains the reorderable items | Reorderer

## Public Methods

Method | Defined By
--- | ---
| constructor( `Object config` ) : void Creates the plugin instance, applies defaults Creates the plugin instance, applies defaults Parameters: `config` : Object Optional config object Returns: void | Reorderer
| createItemDD( `Mixed button` ) : void Sets up the given Toolbar item as a draggable Sets up the given Toolbar item as a draggable Parameters: `button` : Mixed The item to make draggable (usually an Ext.Button instance) Returns: void | Reorderer
| doReorder( `Object mappings` ) : void Abstract function to perform the actual reordering. This MUST be overridden in a subclass Abstract function to perform the actual reordering. This MUST be overridden in a subclass Parameters: `mappings` : Object Mappings of the old item indexes to new item indexes Returns: void | Reorderer
| endDrag() : void After the drag has been completed, make sure the button being dragged makes it back to the correct location and reset... After the drag has been completed, make sure the button being dragged makes it back to the correct location and resets its z index Parameters: None. Returns: void | Reorderer
| getItems() : Array Returns an array of items which will be made draggable. This defaults to the contents of this.target.items, but can b... Returns an array of items which will be made draggable. This defaults to the contents of this.target.items, but can be overridden - e.g. for TabPanels Parameters: None. Returns: `Array` The array of items which will be made draggable | Reorderer
| init( `Mixed target` ) : void Initializes the plugin, stores a reference to the target Initializes the plugin, stores a reference to the target Parameters: `target` : Mixed The target component which contains the reorderable items Returns: void | Reorderer
| initEvents() : void Adds before-reorder and reorder events to the target component Adds before-reorder and reorder events to the target component Parameters: None. Returns: void | Reorderer
| reorder( `Object mappings` ) : void Reorders the items in the target component according to the given mapping object. Example: this.reorder({ 1: 5, 3: 2 ... Reorders the items in the target component according to the given mapping object. Example: this.reorder({ 1: 5, 3: 2 }); Would move the item at index 1 to index 5, and the item at index 3 to index 2 Parameters: `mappings` : Object Object containing current item index as key and new index as property Returns: void | Reorderer

## Public Events

Event | Defined By
--- | ---
| before-reorder : ( `Object mappings`, `Mixed component`, `Ext.ux.TabReorderer this` ) Fires before a reorder occurs. Return false to cancel Fires before a reorder occurs. Return false to cancel Listeners will be called with the following arguments: `mappings` : Object Mappings of the old item indexes to new item indexes `component` : Mixed The target component `this` : Ext.ux.TabReorderer The plugin instance | Reorderer
| reorder : ( `Object mappings`, `Mixed component`, `Ext.ux.TabReorderer this` ) Fires after a reorder has occured. Fires after a reorder has occured. Listeners will be called with the following arguments: `mappings` : Object Mappings of the old item indexes to the new item indexes `component` : Mixed The target component `this` : Ext.ux.TabReorderer The plugin instance | Reorderer