For up to date documentation and features, visit http://docs.sencha.com/ext-js/4-0

Sencha Documentation

Hierarchy

Mixins

A single item of a legend (marker plus label)

Defined By

Config Options

Other Configs

 

Specify true if the addAll function should add function references to the collection. Defaults to false.

Specify true if the addAll function should add function references to the collection. Defaults to false.

 
(optional) A config object containing one or more event handlers to be added to this object during initialization. T...

(optional)

A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once.


DOM events from ExtJs Components


While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this

is usually only done when extra value can be added. For example the DataView's click event passing the node clicked on. To access DOM events directly from a child element of a Component, we need to specify the element option to identify the Component property to add a DOM listener to:

new Ext.panel.Panel({
    width: 400,
    height: 200,
    dockedItems: [{
        xtype: 'toolbar'
    }],
    listeners: {
        click: {
            element: 'el', //bind to the underlying el property on the panel
            fn: function(){ console.log('click el'); }
        },
        dblclick: {
            element: 'body', //bind to the underlying body property on the panel
            fn: function(){ console.log('dblclick body'); }
        }
    }
});

Defined By

Properties

 

The default sort direction to use if one is not specified (defaults to "ASC")

The default sort direction to use if one is not specified (defaults to "ASC")

 
@deprecated 4.0 Replaced by getActiveAnimation Returns thq current animation if this object has any effects actively ...

@deprecated 4.0 Replaced by getActiveAnimation Returns thq current animation if this object has any effects actively running or queued, else returns false.

 

Flag denoting that this object is sortable. Always true.

Flag denoting that this object is sortable. Always true.

 

The property in each item that contains the data to sort. (defaults to null)

The property in each item that contains the data to sort. (defaults to null)

 
sorters : Ext.util.MixedCollection

The collection of Sorters currently applied to this Store

The collection of Sorters currently applied to this Store

 
Stops any running effects and clears this object's internal effects queue if it contains any additional effects that ...

Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.

Defined By

Methods

 
add( Object key, Object o) : void

Add a Sprite to the Group

Add a Sprite to the Group

Parameters

  • key : Object
  • o : Object

Returns

  • void   
 

Adds all elements of an Array or an Object to the collection.

Adds all elements of an Array or an Object to the collection.

Parameters

  • objs : Object/Array

    An Object containing properties which will be added to the collection, or an Array of values, each of which are added to the collection. Functions references will be added to the collection if allowFunctions has been set to true.

Returns

  • void   
 
addEvents( Object/String o, String ) : void

Adds the specified events to the list of events which this Observable may fire.

Adds the specified events to the list of events which this Observable may fire.

Parameters

  • o : Object/String

    Either an object with event names as properties with a value of true or the first event name string if multiple event names are being passed as separate parameters.

  • : String

    [additional] Optional additional event names if multiple event names are being passed as separate parameters. Usage:

    this.addEvents('storeloaded', 'storecleared');
    

Returns

  • void   
 
addListener( String eventName, Function handler, [Object scope], [Object options]) : void

Appends an event handler to this object.

Appends an event handler to this object.

Parameters

  • eventName : String

    The name of the event to listen for. May also be an object who's property names are event names. See

  • handler : Function

    The method the event invokes.

  • scope : Object

    (optional) The scope (this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.

  • options : Object

    (optional) An object containing handler configuration. properties. This may contain any of the following properties:

    • scope : Object
      The scope (this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.
    • delay : Number
      The number of milliseconds to delay the invocation of the handler after the event fires.
    • single : Boolean
      True to add a handler to handle just the next firing of the event, and then remove itself.
    • buffer : Number
      Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is not invoked, but the new handler is scheduled in its place.
    • target : Observable
      Only call the handler if the event was fired on the target Observable, not if the event was bubbled up from a child Observable.
    • element : String
      This option is only valid for listeners bound to Components. The name of a Component property which references an element to add a listener to.

      This option is useful during Component construction to add DOM event listeners to elements of Components which will exist only after the Component is rendered. For example, to add a click listener to a Panel's body:

      new Ext.panel.Panel({
          title: 'The title',
          listeners: {
              click: this.handlePanelClick,
              element: 'body'
          }
      });
      

      When added in this way, the options available are the options applicable to Ext.core.Element.addListener


    Combining Options
    Using the options argument, it is possible to combine different types of listeners:

    A delayed, one-time listener.

    myPanel.on('hide', this.handleClick, this, {
    single: true,
    delay: 100
    });

    Attaching multiple handlers in 1 call
    The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:

    myGridPanel.on({
        cellClick: this.onCellClick,
        mouseover: this.onMouseOver,
        mouseout: this.onMouseOut,
        scope: this // Important. Ensure "this" is correct during handler execution
    });
    
    .

Returns

  • void   
 
addManagedListener( Observable/Element item, Object/String ename, Function fn, Object scope, Object opt) : void

Adds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed.

Adds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed.

Parameters

  • item : Observable/Element

    The item to which to add a listener/listeners.

  • ename : Object/String

    The event name, or an object containing event name properties.

  • fn : Function

    Optional. If the ename parameter was an event name, this is the handler function.

  • scope : Object

    Optional. If the ename parameter was an event name, this is the scope (this reference) in which the handler function is executed.

  • opt : Object

    Optional. If the ename parameter was an event name, this is the addListener options.

Returns

  • void   
 
animate( Object config) : Object
Perform custom animation on this object. This method is applicable to both the the Component class and the Element cl...

Perform custom animation on this object.

This method is applicable to both the the Component class and the Element class. It performs animated transitions of certain properties of this object over a specified timeline.

The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline. Of the properties listed below, only to is mandatory.

Properties include

  • from
    An object which specifies start values for the properties being animated. If not supplied, properties are animated from current settings. The actual properties which may be animated depend upon ths object being animated. See the sections below on Element and Component animation.
  • to
    An object which specifies end values for the properties being animated.
  • duration
    The duration in milliseconds for which the animation will run.
  • easing
    A string value describing an easing type to modify the rate of change from the default linear to non-linear. Values may be one of:
    • ease
    • easeIn
    • easeOut
    • easeInOut
    • backIn
    • backOut
    • elasticIn
    • elasticOut
    • bounceIn
    • bounceOut
  • keyframes
    This is an object which describes the state of animated properties at certain points along the timeline. it is an object containing properties who's names are the percentage along the timeline being described and who's values specify the animation state at that point.
  • listeners
    This is a standard listeners configuration object which may be used to inject behaviour at either the beforeanimate event or the afteranimate event.

Animating an Element

When animating an Element, the following properties may be specified in from, to, and keyframe objects:
  • x
    The page X position in pixels.
  • y
    The page Y position in pixels
  • left
    The element's CSS left value. Units must be supplied.
  • top
    The element's CSS top value. Units must be supplied.
  • width
    The element's CSS width value. Units must be supplied.
  • height
    The element's CSS height value. Units must be supplied.
  • scrollLeft
    The element's scrollLeft value.
  • scrollTop
    The element's scrollLeft value.
  • opacity
    The element's opacity value. This must be a value between 0 and 1.

Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.

Animating a Component

When animating an Element, the following properties may be specified in from, to, and keyframe objects:
  • x
    The Component's page X position in pixels.
  • y
    The Component's page Y position in pixels
  • left
    The Component's left value in pixels.
  • top
    The Component's top value in pixels.
  • width
    The Component's width value in pixels.
  • width
    The Component's width value in pixels.
  • dynamic
    Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. Use sparingly as laying out on every intermediate size change is an expensive operation.

For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:

myWindow = Ext.create('Ext.window.Window', {
    title: 'Test Component animation',
    width: 500,
    height: 300,
    layout: {
        type: 'hbox',
        align: 'stretch'
    },
    items: [{
        title: 'Left: 33%',
        margins: '5 0 5 5',
        flex: 1
    }, {
        title: 'Left: 66%',
        margins: '5 5 5 5',
        flex: 2
    }]
});
myWindow.show();
myWindow.header.el.on('click', function() {
    myWindow.animate({
        to: {
            width: (myWindow.getWidth() == 500) ? 700 : 500,
            height: (myWindow.getHeight() == 300) ? 400 : 300,
        }
    });
});

For performance reasons, by default, the internal layout is only updated when the Window reaches its final "to" size. If dynamic updating of the Window's child Components is required, then configure the animation with dynamic: true and the two child items will maintain their proportions during the animation.

Parameters

  • config : Object

    An object containing properties which describe the animation's start and end states, and the timeline of the animation.

Returns

  • Object   

    this

 
capture( Observable o, Function fn, [Object scope]) : void
Starts capture on the specified Observable. All events will be passed to the supplied function with the event name + ...

Starts capture on the specified Observable. All events will be passed to the supplied function with the event name + standard signature of the event before the event is fired. If the supplied function returns false, the event will not fire.

Parameters

  • o : Observable

    The Observable to capture events from.

  • fn : Function

    The function to call when an event is fired.

  • scope : Object

    (optional) The scope (this reference) in which the function is executed. Defaults to the Observable firing the event.

Returns

  • void   
 

Removes all items from the collection. Fires the clear event when complete.

Removes all items from the collection. Fires the clear event when complete.

Returns

  • void   
 

Removes all listeners for this object including the managed listeners

Removes all listeners for this object including the managed listeners

Returns

  • void   
 

Removes all managed listeners for this object.

Removes all managed listeners for this object.

Returns

  • void   
 

Creates a shallow copy of this collection

Creates a shallow copy of this collection

Returns

  • MixedCollection   
 
collect( String property, String root, [Boolean allowBlank]) : Array

Collects unique values of a particular property in this MixedCollection

Collects unique values of a particular property in this MixedCollection

Parameters

  • property : String

    The property to collect on

  • root : String

    Optional 'root' property to extract the first argument from. This is used mainly when summing fields in records, where the fields are all stored inside the 'data' object

  • allowBlank : Boolean

    (optional) Pass true to allow null, undefined or empty string values

Returns

  • Array   

    The unique values

 

Returns true if the collection contains the passed Object as an item.

Returns true if the collection contains the passed Object as an item.

Parameters

  • o : Object

    The Object to look for in the collection.

Returns

  • Boolean   

    True if the collection contains the Object as an item.

 

Returns true if the collection contains the passed Object as a key.

Returns true if the collection contains the passed Object as a key.

Parameters

  • key : String

    The key to look for in the collection.

Returns

  • Boolean   

    True if the collection contains the Object as a key.

 

Creates all the individual sprites for this legend item

Creates all the individual sprites for this legend item

Parameters

  • config : Object

Returns

  • void   
 

Destroys the SpriteGroup

Destroys the SpriteGroup

Returns

  • void   
 
each( Function fn, [Object scope]) : void
Executes the specified function once for every item in the collection, passing the following arguments: item : Mixe...

Executes the specified function once for every item in the collection, passing the following arguments:

  • item : Mixed

    The collection item

  • index : Number

    The item's index

  • length : Number

    The total number of items in the collection

The function should return a boolean value. Returning false from the function will stop the iteration.

Parameters

  • fn : Function

    The function to execute for each item.

  • scope : Object

    (optional) The scope (this reference) in which the function is executed. Defaults to the current item in the iteration.

Returns

  • void   
 
eachKey( Function fn, [Object scope]) : void
Executes the specified function once for every key in the collection, passing each key, and its associated item as th...

Executes the specified function once for every key in the collection, passing each key, and its associated item as the first two parameters.

Parameters

  • fn : Function

    The function to execute for each item.

  • scope : Object

    (optional) The scope (this reference) in which the function is executed. Defaults to the browser window.

Returns

  • void   
 
enableBubble( String/Array events) : void
Enables events fired by this Observable to bubble up an owner hierarchy by calling this.getBubbleTarget() if present....

Enables events fired by this Observable to bubble up an owner hierarchy by calling this.getBubbleTarget() if present. There is no implementation in the Observable base class.

This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.

Example:

Ext.override(Ext.form.field.Base, {
//  Add functionality to Field's initComponent to enable the change event to bubble
initComponent : Ext.Function.createSequence(Ext.form.field.Base.prototype.initComponent, function() {
    this.enableBubble('change');
}),

//  We know that we want Field's events to bubble directly to the FormPanel.
getBubbleTarget : function() {
    if (!this.formPanel) {
        this.formPanel = this.findParentByType('form');
    }
    return this.formPanel;
}
});

var myForm = new Ext.formPanel({
title: 'User Details',
items: [{
    ...
}],
listeners: {
    change: function() {
        // Title goes red if form has been modified.
        myForm.header.setStyle('color', 'red');
    }
}
});

Parameters

  • events : String/Array

    The event name to bubble, or an Array of event names.

Returns

  • void   
 
filter( Array/String property, String/RegExp value, [Boolean anyMatch], [Boolean caseSensitive]) : MixedCollection
Filters the objects in this collection by a set of Filters, or by a single property/value pair with optional paramete...

Filters the objects in this collection by a set of Filters, or by a single property/value pair with optional parameters for substring matching and case sensitivity. See Filter for an example of using Filter objects (preferred). Alternatively, MixedCollection can be easily filtered by property like this:

//create a simple store with a few people defined
var people = new Ext.util.MixedCollection();
people.addAll([
    {id: 1, age: 25, name: 'Ed'},
    {id: 2, age: 24, name: 'Tommy'},
    {id: 3, age: 24, name: 'Arne'},
    {id: 4, age: 26, name: 'Aaron'}
]);

//a new MixedCollection containing only the items where age == 24
var middleAged = people.filter('age', 24);

Parameters

  • property : Array/String

    A property on your objects, or an array of Filter objects

  • value : String/RegExp

    Either string that the property values should start with or a RegExp to test against the property

  • anyMatch : Boolean

    (optional) True to match any part of the string, not just the beginning

  • caseSensitive : Boolean

    (optional) True for case sensitive comparison (defaults to False).

Returns

  • MixedCollection   

    The new filtered collection

 
filterBy( Function fn, [Object scope]) : MixedCollection
Filter by a function. Returns a new collection that has been filtered. The passed function will be called with each o...

Filter by a function. Returns a new collection that has been filtered. The passed function will be called with each object in the collection. If the function returns true, the value is included otherwise it is filtered.

Parameters

  • fn : Function

    The function to be called, it will receive the args o (the object), k (the key)

  • scope : Object

    (optional) The scope (this reference) in which the function is executed. Defaults to this MixedCollection.

Returns

  • MixedCollection   

    The new filtered collection

 
findBy( Function fn, [Object scope]) : Object

Returns the first item in the collection which elicits a true return value from the passed selection function.

Returns the first item in the collection which elicits a true return value from the passed selection function.

Parameters

  • fn : Function

    The selection function to execute for each item.

  • scope : Object

    (optional) The scope (this reference) in which the function is executed. Defaults to the browser window.

Returns

  • Object   

    The first item in the collection which returned true from the selection function.

 
findIndex( String property, String/RegExp value, [Number start], [Boolean anyMatch], [Boolean caseSensitive]) : Number

Finds the index of the first matching object in this collection by a specific property/value.

Finds the index of the first matching object in this collection by a specific property/value.

Parameters

  • property : String

    The name of a property on your objects.

  • value : String/RegExp

    A string that the property values should start with or a RegExp to test against the property.

  • start : Number

    (optional) The index to start searching at (defaults to 0).

  • anyMatch : Boolean

    (optional) True to match any part of the string, not just the beginning.

  • caseSensitive : Boolean

    (optional) True for case sensitive comparison.

Returns

  • Number   

    The matched index or -1

 
findIndexBy( Function fn, [Object scope], [Number start]) : Number
Find the index of the first matching object in this collection by a function. If the function returns true it is cons...

Find the index of the first matching object in this collection by a function. If the function returns true it is considered a match.

Parameters

  • fn : Function

    The function to be called, it will receive the args o (the object), k (the key).

  • scope : Object

    (optional) The scope (this reference) in which the function is executed. Defaults to this MixedCollection.

  • start : Number

    (optional) The index to start searching at (defaults to 0).

Returns

  • Number   

    The matched index or -1

 
fireEvent( String eventName, Object... args) : Boolean
Fires the specified event with the passed parameters (minus the event name). An event may be set to bubble up an Ob...

Fires the specified event with the passed parameters (minus the event name).

An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget) by calling enableBubble.

Parameters

  • eventName : String

    The name of the event to fire.

  • args : Object...

    Variable number of parameters are passed to handlers.

Returns

  • Boolean   

    returns false if any of the handlers return false otherwise it returns true.

 

Returns the first item in the collection.

Returns the first item in the collection.

Returns

  • Object   

    the first item in the collection..

 
Returns the item associated with the passed key OR index. Key has priority over index. This is the equivalent of cal...

Returns the item associated with the passed key OR index. Key has priority over index. This is the equivalent of calling key first, then if nothing matched calling getAt.

Parameters

  • key : String/Number

    The key or index of the item.

Returns

  • Object   

    If the item is found, returns the item. If the item was not found, returns undefined. If an item was found, but is a Class, returns null.

 

Returns thq current animation if this object has any effects actively running or queued, else returns false.

Returns thq current animation if this object has any effects actively running or queued, else returns false.

Returns

  • Mixed   

    anim if element has active effects, else false

 

Returns the item at the specified index.

Returns the item at the specified index.

Parameters

  • index : Number

    The index of the item.

Returns

  • Object   

    The item at the specified index.

 

Returns the group bounding box. Behaves like Ext.draw.Sprite getBBox method.

Returns the group bounding box. Behaves like Ext.draw.Sprite getBBox method.

Returns

  • void   
 

Returns the item associated with the passed key.

Returns the item associated with the passed key.

Parameters

  • key : String/Number

    The key of the item.

Returns

  • Object   

    The item associated with the passed key.

 

Returns the number of items in the collection.

Returns the number of items in the collection.

Returns

  • Number   

    the number of items in the collection.

 
MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation simply returns i...

MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation simply returns item.id but you can provide your own implementation to return a different value as in the following examples:

// normal way
var mc = new Ext.util.MixedCollection();
mc.add(someEl.dom.id, someEl);
mc.add(otherEl.dom.id, otherEl);
//and so on

// using getKey
var mc = new Ext.util.MixedCollection();
mc.getKey = function(el){
   return el.dom.id;
};
mc.add(someEl);
mc.add(otherEl);

// or via the constructor
var mc = new Ext.util.MixedCollection(false, function(el){
   return el.dom.id;
});
mc.add(someEl);
mc.add(otherEl);

Parameters

  • item : Object

    The item for which to find the key.

Returns

  • Object   

    The key for the passed item.

 
getRange( [Number startIndex], [Number endIndex]) : Array

Returns a range of items in this collection

Returns a range of items in this collection

Parameters

  • startIndex : Number

    (optional) The starting index. Defaults to 0.

  • endIndex : Number

    (optional) The ending index. Defaults to the last item.

Returns

  • Array   

    An array of items

 

Returns an object describing the current sort state of this Store.

Returns an object describing the current sort state of this Store.

Returns

  • Object   

    The sort state of the Store. An object with two properties:

    • field : String

      The name of the field by which the Records are sorted.

    • direction : String

      The sort order, 'ASC' or 'DESC' (case-sensitive).

    See sortInfo for additional details.

 
hasListener( String eventName) : Boolean

Checks to see if this object has any listeners for a specified event

Checks to see if this object has any listeners for a specified event

Parameters

  • eventName : String

    The name of the event to check for

Returns

  • Boolean   

    True if the event is being listened for, else false

 

Hides all sprites. If the first parameter of the method is true then a redraw will be forced for each sprite.

Hides all sprites. If the first parameter of the method is true then a redraw will be forced for each sprite.

Parameters

  • attrs : Object

Returns

  • void   
 

Returns index within the collection of the passed Object.

Returns index within the collection of the passed Object.

Parameters

  • o : Object

    The item to find the index of.

Returns

  • Number   

    index of the item. Returns -1 if not found.

 

Returns index within the collection of the passed key.

Returns index within the collection of the passed key.

Parameters

  • key : String

    The key to find the index of.

Returns

  • Number   

    index of the key.

 
Performs initialization of this mixin. Component classes using this mixin should call this method during their own in...

Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.

Returns

  • void   
 
insert( Number index, String key, [Object o]) : Object

Inserts an item at the specified index in the collection. Fires the add event when complete.

Inserts an item at the specified index in the collection. Fires the add event when complete.

Parameters

  • index : Number

    The index to insert the item at.

  • key : String

    The key to associate with the new item, or the item itself.

  • o : Object

    (optional) If the second parameter was a key, the new item.

Returns

  • Object   

    The item inserted.

 

Returns the last item in the collection.

Returns the last item in the collection.

Returns

  • Object   

    the last item in the collection..

 
observe( Function c, Object listeners) : void
Sets observability on the passed class constructor. This makes any event fired on any instance of the passed class a...

Sets observability on the passed class constructor.

This makes any event fired on any instance of the passed class also fire a single event through the class allowing for central handling of events on many instances at once.

Usage:

Ext.util.Observable.observe(Ext.data.Connection);
Ext.data.Connection.on('beforerequest', function(con, options) {
    console.log('Ajax request made to ' + options.url);
});

Parameters

  • c : Function

    The class constructor to make observable.

  • listeners : Object

    An object containing a series of listeners to add. See addListener.

Returns

  • void   
 
on( String eventName, Function handler, [Object scope], [Object options]) : void

Appends an event handler to this object (shorthand for addListener.)

Appends an event handler to this object (shorthand for addListener.)

Parameters

  • eventName : String

    The type of event to listen for

  • handler : Function

    The method the event invokes

  • scope : Object

    (optional) The scope (this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.

  • options : Object

    (optional) An object containing handler configuration.

Returns

  • void   
 
relayEvents( Object origin, Array events, Object prefix) : void

Relays selected events from the specified Observable as if the events were fired by this.

Relays selected events from the specified Observable as if the events were fired by this.

Parameters

  • origin : Object

    The Observable whose events this object is to relay.

  • events : Array

    Array of event names to relay.

  • prefix : Object

Returns

  • void   
 

Removes all added captures from the Observable.

Removes all added captures from the Observable.

Parameters

  • o : Observable

    The Observable to release

Returns

  • void   
 

Remove a Sprite from the Group

Remove a Sprite from the Group

Parameters

  • o : Object

Returns

  • void   
 
removeAll( Array items) : Ext.util.MixedCollection

Remove all items in the passed array from the collection.

Remove all items in the passed array from the collection.

Parameters

  • items : Array

    An array of items to be removed.

Returns

  • Ext.util.MixedCollection   

    this object

 

Remove an item from a specified index in the collection. Fires the remove event when complete.

Remove an item from a specified index in the collection. Fires the remove event when complete.

Parameters

  • index : Number

    The index within the collection of the item to remove.

Returns

  • Object   

    The item removed or false if no item was removed.

 

Removed an item associated with the passed key fom the collection.

Removed an item associated with the passed key fom the collection.

Parameters

  • key : String

    The key of the item to remove.

Returns

  • Object   

    The item removed or false if no item was removed.

 
removeListener( String eventName, Function handler, [Object scope]) : void

Removes an event handler.

Removes an event handler.

Parameters

  • eventName : String

    The type of event the handler was associated with.

  • handler : Function

    The handler to remove. This must be a reference to the function passed into the addListener call.

  • scope : Object

    (optional) The scope originally specified for the handler.

Returns

  • void   
 
removeManagedListener( Observable|Element item, Object|String ename, Function fn, Object scope) : void

Removes listeners that were added by the mon method.

Removes listeners that were added by the mon method.

Parameters

  • item : Observable|Element

    The item from which to remove a listener/listeners.

  • ename : Object|String

    The event name, or an object containing event name properties.

  • fn : Function

    Optional. If the ename parameter was an event name, this is the handler function.

  • scope : Object

    Optional. If the ename parameter was an event name, this is the scope (this reference) in which the handler function is executed.

Returns

  • void   
 
Reorders each of the items based on a mapping from old index to new index. Internally this just translates into a sor...

Reorders each of the items based on a mapping from old index to new index. Internally this just translates into a sort. The 'sort' event is fired whenever reordering has occured.

Parameters

  • mapping : Object

    Mapping from old item index to new item index

Returns

  • void   
 
replace( String key, [Object o]) : Object

Replaces an item in the collection. Fires the replace event when complete.

Replaces an item in the collection. Fires the replace event when complete.

Parameters

  • key : String

    The key associated with the item to replace, or the replacement item.

    If you supplied a getKey implementation for this MixedCollection, or if the key of your stored items is in a property called id, then the MixedCollection will be able to derive the key of the replacement item. If you want to replace an item with one having the same key value, then just pass the replacement item in this parameter.

  • o : Object

    {Object} o (optional) If the first parameter passed was a key, the item to associate with that key.

Returns

  • Object   

    The new item.

 
Resume firing events. (see suspendEvents) If events were suspended using the queueSuspended parameter, then all event...

Resume firing events. (see suspendEvents) If events were suspended using the queueSuspended parameter, then all events fired during event suspension will be sent to any listeners now.

Returns

  • void   
 
Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite ...

Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of syncFx.

Returns

  • Ext.core.Element   

    The Element

 
setAttributes( Object attrs, Object redraw) : void
Iterates through all sprites calling setAttributes on each one. For more information Ext.draw.Sprite provides a des...

Iterates through all sprites calling setAttributes on each one. For more information Ext.draw.Sprite provides a description of the attributes that can be set with this method.

Parameters

  • attrs : Object
  • redraw : Object

Returns

  • void   
 

Shows all sprites. If the first parameter of the method is true then a redraw will be forced for each sprite.

Shows all sprites. If the first parameter of the method is true then a redraw will be forced for each sprite.

Parameters

  • attrs : Object

Returns

  • void   
 
sort( String|Array sorters, String direction, Object where, Object doSort) : void
Sorts the data in the Store by one or more of its properties. Example usage: //sort by a single field myStore.sort(...

Sorts the data in the Store by one or more of its properties. Example usage:

//sort by a single field
myStore.sort('myField', 'DESC');

//sorting by multiple fields
myStore.sort([
    {
        property : 'age',
        direction: 'ASC'
    },
    {
        property : 'name',
        direction: 'DESC'
    }
]);

Internally, Store converts the passed arguments into an array of Ext.util.Sorter instances, and delegates the actual sorting to its internal Ext.util.MixedCollection.

When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:

store.sort('myField');
store.sort('myField');
     

Is equivalent to this code, because Store handles the toggling automatically:

store.sort('myField', 'ASC');
store.sort('myField', 'DESC');

Parameters

  • sorters : String|Array

    Either a string name of one of the fields in this Store's configured Model, or an Array of sorter configurations.

  • direction : String

    The overall direction to sort the data by. Defaults to "ASC".

  • where : Object
  • doSort : Object

Returns

  • void   
 

Sorts the collection by a single sorter function

Sorts the collection by a single sorter function

Parameters

  • sorterFn : Function

    The function to sort by

Returns

  • void   
 
sortByKey( [String direction], [Function fn]) : void

Sorts this collection by keys.

Sorts this collection by keys.

Parameters

  • direction : String

    (optional) 'ASC' or 'DESC'. Defaults to 'ASC'.

  • fn : Function

    (optional) Comparison function that defines the sort order. Defaults to sorting by case insensitive string.

Returns

  • void   
 
@deprecated 4.0 Replaced by stopAnimation Stops any running effects and clears this object's internal effects queue i...

@deprecated 4.0 Replaced by stopAnimation Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.

Returns

  • Ext.core.Element   

    The Element

 
sum( String property, String root, [Number start], [Number end]) : Number

Collects all of the values of the given property and returns their sum

Collects all of the values of the given property and returns their sum

Parameters

  • property : String

    The property to sum by

  • root : String

    Optional 'root' property to extract the first argument from. This is used mainly when summing fields in records, where the fields are all stored inside the 'data' object

  • start : Number

    (optional) The record index to start at (defaults to 0)

  • end : Number

    (optional) The record index to end at (defaults to -1)

Returns

  • Number   

    The total

 
suspendEvents( Boolean queueSuspended) : void

Suspend the firing of all events. (see resumeEvents)

Suspend the firing of all events. (see resumeEvents)

Parameters

  • queueSuspended : Boolean

    Pass as true to queue up suspended events to be fired after the resumeEvents call instead of discarding all suspended events;

Returns

  • void   
 
Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of ...

Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of sequenceFx.

Returns

  • Ext.core.Element   

    The Element

 
un( String eventName, Function handler, [Object scope]) : void

Removes an event handler (shorthand for removeListener.)

Removes an event handler (shorthand for removeListener.)

Parameters

  • eventName : String

    The type of event the handler was associated with.

  • handler : Function

    The handler to remove. This must be a reference to the function passed into the addListener call.

  • scope : Object

    (optional) The scope originally specified for the handler.

Returns

  • void   
 

Update the positions of all this item's sprites to match the root position of the legend box.

Update the positions of all this item's sprites to match the root position of the legend box.

Parameters

  • relativeTo : Object

    (optional) If specified, this object's 'x' and 'y' values will be used

                as the reference point for the relative positioning. Defaults to the Legend.
    

Returns

  • void   
Defined By

Events

 
add( Number index, Object o, String key)

Fires when an item is added to the collection.

Fires when an item is added to the collection.

Parameters

  • index : Number

    The index at which the item was added.

  • o : Object

    The item added.

  • key : String

    The key associated with the added item.

 

Fires when the collection is cleared.

Fires when the collection is cleared.

 

Fires when an item is removed from the collection.

Fires when an item is removed from the collection.

Parameters

  • o : Object

    The item being removed.

  • key : String

    (optional) The key associated with the removed item.

 
replace( String key, Object old, Object new)

Fires when an item is replaced in the collection.

Fires when an item is replaced in the collection.

Parameters

  • key : String

    he key associated with the new added.

  • old : Object

    The item being replaced.

  • new : Object

    The new item.