Ext.data.JsonP.Ext_util_MixedCollection({"mixins":["Ext.util.Sortable"],"code_type":"ext_define","inheritable":false,"component":false,"meta":{},"mixedInto":[],"uses":[],"aliases":{},"parentMixins":["Ext.util.Observable"],"superclasses":["Ext.Base","Ext.util.AbstractMixedCollection"],"members":{"event":[{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"event","name":"add","id":"event-add"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"event","name":"clear","id":"event-clear"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"event","name":"remove","id":"event-remove"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"event","name":"replace","id":"event-replace"}],"property":[{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"$className","id":"property-S-className"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"configMap","id":"property-configMap"},{"meta":{},"owner":"Ext.util.Sortable","tagname":"property","name":"defaultSortDirection","id":"property-defaultSortDirection"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"property","name":"eventsSuspended","id":"property-eventsSuspended"},{"meta":{"private":true},"owner":"Ext.util.AbstractMixedCollection","tagname":"property","name":"generation","id":"property-generation"},{"meta":{"readonly":true},"owner":"Ext.util.Observable","tagname":"property","name":"hasListeners","id":"property-hasListeners"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"initConfigList","id":"property-initConfigList"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"initConfigMap","id":"property-initConfigMap"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"isInstance","id":"property-isInstance"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"property","name":"isMixedCollection","id":"property-isMixedCollection"},{"meta":{},"owner":"Ext.util.Observable","tagname":"property","name":"isObservable","id":"property-isObservable"},{"meta":{},"owner":"Ext.util.Sortable","tagname":"property","name":"isSortable","id":"property-isSortable"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"property","name":"self","id":"property-self"},{"meta":{},"owner":"Ext.util.Sortable","tagname":"property","name":"sortRoot","id":"property-sortRoot"},{"meta":{},"owner":"Ext.util.Sortable","tagname":"property","name":"sorters","id":"property-sorters"}],"css_var":[],"method":[{"meta":{},"owner":"Ext.util.MixedCollection","tagname":"method","name":"constructor","id":"method-constructor"},{"meta":{"private":true},"owner":"Ext.util.MixedCollection","tagname":"method","name":"_sort","id":"method-_sort"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"add","id":"method-add"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"addAll","id":"method-addAll"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"addEvents","id":"method-addEvents"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"addListener","id":"method-addListener"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"addManagedListener","id":"method-addManagedListener"},{"meta":{"deprecated":{"text":"as of 4.1. Use {@link #callParent} instead."},"protected":true},"owner":"Ext.Base","tagname":"method","name":"callOverridden","id":"method-callOverridden"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"callParent","id":"method-callParent"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"clear","id":"method-clear"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"clearListeners","id":"method-clearListeners"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"clearManagedListeners","id":"method-clearManagedListeners"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"clone","id":"method-clone"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"collect","id":"method-collect"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"configClass","id":"method-configClass"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"contains","id":"method-contains"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"containsKey","id":"method-containsKey"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"continueFireEvent","id":"method-continueFireEvent"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"createRelayer","id":"method-createRelayer"},{"meta":{"private":true},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"createValueMatcher","id":"method-createValueMatcher"},{"meta":{"private":true},"owner":"Ext.util.Sortable","tagname":"method","name":"decodeSorters","id":"method-decodeSorters"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"destroy","id":"method-destroy"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"each","id":"method-each"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"eachKey","id":"method-eachKey"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"enableBubble","id":"method-enableBubble"},{"meta":{"private":true},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"extractValues","id":"method-extractValues"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"filter","id":"method-filter"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"filterBy","id":"method-filterBy"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"findBy","id":"method-findBy"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"findIndex","id":"method-findIndex"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"findIndexBy","id":"method-findIndexBy"},{"meta":{},"owner":"Ext.util.MixedCollection","tagname":"method","name":"findInsertionIndex","id":"method-findInsertionIndex"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"fireEvent","id":"method-fireEvent"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"first","id":"method-first"},{"meta":{},"owner":"Ext.util.Sortable","tagname":"method","name":"generateComparator","id":"method-generateComparator"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"get","id":"method-get"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"getAt","id":"method-getAt"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"getBubbleParent","id":"method-getBubbleParent"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"getByKey","id":"method-getByKey"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"getConfig","id":"method-getConfig"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"getCount","id":"method-getCount"},{"meta":{"protected":true},"owner":"Ext.util.Sortable","tagname":"method","name":"getFirstSorter","id":"method-getFirstSorter"},{"meta":{},"owner":"Ext.Base","tagname":"method","name":"getInitialConfig","id":"method-getInitialConfig"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"getKey","id":"method-getKey"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"getRange","id":"method-getRange"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"hasConfig","id":"method-hasConfig"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"hasListener","id":"method-hasListener"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"indexOf","id":"method-indexOf"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"indexOfKey","id":"method-indexOfKey"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"initConfig","id":"method-initConfig"},{"meta":{},"owner":"Ext.util.Sortable","tagname":"method","name":"initSortable","id":"method-initSortable"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"insert","id":"method-insert"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"last","id":"method-last"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"mon","id":"method-mon"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"mun","id":"method-mun"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"on","id":"method-on"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"onConfigUpdate","id":"method-onConfigUpdate"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"prepareClass","id":"method-prepareClass"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"relayEvents","id":"method-relayEvents"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"remove","id":"method-remove"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"removeAll","id":"method-removeAll"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"removeAt","id":"method-removeAt"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"removeAtKey","id":"method-removeAtKey"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"removeListener","id":"method-removeListener"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"removeManagedListener","id":"method-removeManagedListener"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"removeManagedListenerItem","id":"method-removeManagedListenerItem"},{"meta":{},"owner":"Ext.util.MixedCollection","tagname":"method","name":"reorder","id":"method-reorder"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"replace","id":"method-replace"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"resumeEvents","id":"method-resumeEvents"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"setConfig","id":"method-setConfig"},{"meta":{},"owner":"Ext.util.Sortable","tagname":"method","name":"sort","id":"method-sort"},{"meta":{},"owner":"Ext.util.MixedCollection","tagname":"method","name":"sortBy","id":"method-sortBy"},{"meta":{},"owner":"Ext.util.MixedCollection","tagname":"method","name":"sortByKey","id":"method-sortByKey"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"statics","id":"method-statics"},{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"method","name":"sum","id":"method-sum"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"suspendEvents","id":"method-suspendEvents"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"un","id":"method-un"}],"css_mixin":[],"cfg":[{"meta":{},"owner":"Ext.util.AbstractMixedCollection","tagname":"cfg","name":"allowFunctions","id":"cfg-allowFunctions"},{"meta":{},"owner":"Ext.util.Observable","tagname":"cfg","name":"listeners","id":"cfg-listeners"}]},"tagname":"class","extends":"Ext.util.AbstractMixedCollection","html":"

Hierarchy

Mixins

Inherited mixins

Subclasses

Files

\nRepresents a collection of a set of key and value pairs. Each key in the MixedCollection\nmust be unique, the same key cannot exist twice. This collection is ordered, items in the\ncollection can be accessed by index or via the key. Newly added items are added to\nthe end of the collection. This class is similar to Ext.util.HashMap however it\nis heavier and provides more functionality. Sample usage:\n

var coll = new Ext.util.MixedCollection();\ncoll.add('key1', 'val1');\ncoll.add('key2', 'val2');\ncoll.add('key3', 'val3');\n\nconsole.log(coll.get('key1')); // prints 'val1'\nconsole.log(coll.indexOfKey('key3')); // prints 2\n
\n\n

\nThe MixedCollection also has support for sorting and filtering of the values in the collection.\n

var coll = new Ext.util.MixedCollection();\ncoll.add('key1', 100);\ncoll.add('key2', -100);\ncoll.add('key3', 17);\ncoll.add('key4', 0);\nvar biggerThanZero = coll.filterBy(function(value){\n    return value > 0;\n});\nconsole.log(biggerThanZero.getCount()); // prints 2\n
\n

\n\n
Defined By

Config options

Specify true if the addAll\nfunction should add function references to the collection. ...

Specify true if the addAll\nfunction should add function references to the collection. Defaults to\nfalse.

\n

Defaults to: false

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

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

\n\n

DOM events from Ext JS Components

\n\n

While some Ext JS Component classes export selected DOM events (e.g. \"click\", \"mouseover\" etc), this is usually\nonly done when extra value can be added. For example the DataView's itemclick event passing the node clicked on. To access DOM events directly from a\nchild element of a Component, we need to specify the element option to identify the Component property to add a\nDOM listener to:

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

Properties

Defined By

Instance Properties

...
\n

Defaults to: "Ext.Base"

...
\n

Defaults to: {}

The default sort direction to use if one is not specified. ...

The default sort direction to use if one is not specified.

\n

Defaults to: "ASC"

Initial suspended call count. ...

Initial suspended call count. Incremented when suspendEvents is called, decremented when resumeEvents is called.

\n

Defaults to: 0

Mutation counter which is incremented upon add and remove. ...

Mutation counter which is incremented upon add and remove.

\n

Defaults to: 0

This object holds a key for any event that has a listener. ...

This object holds a key for any event that has a listener. The listener may be set\ndirectly on the instance, or on its class or a super class (via observe) or\non the MVC EventBus. The values of this object are truthy\n(a non-zero number) and falsy (0 or undefined). They do not represent an exact count\nof listeners. The value for an event is truthy if the event must be fired and is\nfalsy if there is no need to fire the event.

\n\n

The intended use of this property is to avoid the expense of fireEvent calls when\nthere are no listeners. This can be particularly helpful when one would otherwise\nhave to call fireEvent hundreds or thousands of times. It is used like this:

\n\n
 if (this.hasListeners.foo) {\n     this.fireEvent('foo', this, arg1);\n }\n
\n
...
\n

Defaults to: []

...
\n

Defaults to: {}

...
\n

Defaults to: true

true in this class to identify an object as an instantiated MixedCollection, or subclass thereof. ...

true in this class to identify an object as an instantiated MixedCollection, or subclass thereof.

\n

Defaults to: true

true in this class to identify an object as an instantiated Observable, or subclass thereof. ...

true in this class to identify an object as an instantiated Observable, or subclass thereof.

\n

Defaults to: true

true in this class to identify an object as an instantiated Sortable, or subclass thereof. ...

true in this class to identify an object as an instantiated Sortable, or subclass thereof.

\n

Defaults to: true

Get the reference to the current class from which this object was instantiated. ...

Get 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

\n\n
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\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
\n

The property in each item that contains the data to sort.

\n

The property in each item that contains the data to sort.

\n

The collection of Sorters currently applied to this Store

\n

The collection of Sorters currently applied to this Store

\n
Defined By

Static Properties

...
\n

Defaults to: []

Methods

Defined By

Instance Methods

Ext.util.MixedCollection
view source
new( Boolean allowFunctions, Function keyFn ) : Object
Creates new MixedCollection. ...

Creates new MixedCollection.

\n

Parameters

  • allowFunctions : Boolean

    Specify true if the addAll\nfunction should add function references to the collection. Defaults to\nfalse.

    \n
  • keyFn : Function

    A function that can accept an item of the type(s) stored in this MixedCollection\nand return the key value for that item. This is used when available to look up the key on items that\nwere passed without an explicit key parameter to a MixedCollection method. Passing this parameter is\nequivalent to providing an implementation for the getKey method.

    \n

Returns

Ext.util.MixedCollection
view source
( String property, [String dir], [Function fn] )private
Performs the actual sorting based on a direction and a sorting function. ...

Performs the actual sorting based on a direction and a sorting function. Internally,\nthis creates a temporary array of all items in the MixedCollection, sorts it and then writes\nthe sorted array data back into this.items and this.keys

\n

Parameters

  • property : String

    Property to sort by ('key', 'value', or 'index')

    \n
  • dir : String (optional)

    Direction to sort 'ASC' or 'DESC'. Defaults to 'ASC'.

    \n
  • fn : Function (optional)

    Comparison function that defines the sort order.\nDefaults to sorting by numeric value.

    \n
Adds an item to the collection. ...

Adds an item to the collection. Fires the add event when complete.

\n

Parameters

  • key : String/Object

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

    \n\n

    If a getKey implementation was specified for this MixedCollection,\nor if the key of the stored items is in a property called id,\nthe MixedCollection will be able to derive the key for the new item.\nIn this case just pass the new item in this parameter.

    \n
  • o : Object (optional)

    The item to add.

    \n

Returns

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

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

\n

Parameters

  • objs : Object/Array

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

    \n
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.

\n

Parameters

  • eventNames : Object/String...

    Either an object with event names as properties with\na value of true. For example:

    \n\n
    this.addEvents({\n    storeloaded: true,\n    storecleared: true\n});\n
    \n\n

    Or any number of event names as separate parameters. For example:

    \n\n
    this.addEvents('storeloaded', 'storecleared');\n
    \n
Appends an event handler to this object. ...

Appends an event handler to this object. For example:

\n\n
myGridPanel.on(\"mouseover\", this.onMouseOver, this);\n
\n\n

The method also allows for a single argument to be passed which is a config object\ncontaining properties which specify multiple events. For example:

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

One can also specify options for each event handler separately:

\n\n
myGridPanel.on({\n    cellClick: {fn: this.onCellClick, scope: this, single: true},\n    mouseover: {fn: panel.onMouseOver, scope: panel}\n});\n
\n\n

Names of methods in a specified scope may also be used. Note that\nscope MUST be specified to use this option:

\n\n
myGridPanel.on({\n    cellClick: {fn: 'onCellClick', scope: this, single: true},\n    mouseover: {fn: 'onMouseOver', scope: panel}\n});\n
\n

Parameters

  • eventName : String/Object

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

    \n\n
  • fn : Function (optional)

    The method the event invokes, or if scope is specified, the name* of the method within\nthe specified scope. Will be called with arguments\ngiven to fireEvent plus the options parameter described below.

    \n\n
  • scope : Object (optional)

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

    \n\n
  • options : Object (optional)

    An object containing handler configuration.

    \n\n\n\n\n

    Note: Unlike in ExtJS 3.x, the options object will also be passed as the last\nargument to every event handler.

    \n\n\n\n\n

    This object may contain any of the following properties:

    \n\n
    • scope : Object

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

      \n\n
    • delay : Number

      The number of milliseconds to delay the invocation of the handler after the event fires.

      \n\n
    • single : Boolean

      True to add a handler to handle just the next firing of the event, and then remove itself.

      \n\n
    • buffer : Number

      Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed\n by the specified number of milliseconds. If the event fires again within that time,\n the original handler is not invoked, but the new handler is scheduled in its place.

      \n\n
    • target : Ext.util.Observable

      Only call the handler if the event was fired on the target Observable, not if the event\n was bubbled up from a child Observable.

      \n\n
    • element : String

      This option is only valid for listeners bound to Components.\n The name of a Component property which references an element to add a listener to.

      \n\n\n\n\n

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

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

      Combining Options

      \n\n\n\n\n

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

      \n\n\n\n\n

      A delayed, one-time listener.

      \n\n\n\n\n
      myPanel.on('hide', this.handleClick, this, {\n    single: true,\n    delay: 100\n});\n
      \n\n
Adds listeners to any Observable object (or Ext.Element) which are automatically removed when this Component is\ndestr...

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

\n

Parameters

  • item : Ext.util.Observable/Ext.Element

    The item to which to add a listener/listeners.

    \n\n
  • ename : Object/String

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

    \n\n
  • fn : Function (optional)

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

    \n\n
  • scope : Object (optional)

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

    \n\n
  • opt : Object (optional)

    If the ename parameter was an event name, this is the\naddListener options.

    \n\n
( Array/Arguments args ) : Objectdeprecatedprotected
Call the original method that was previously overridden with override\n\nExt.define('My.Cat', {\n constructor: functi...

Call the original method that was previously overridden with override

\n\n
Ext.define('My.Cat', {\n    constructor: function() {\n        alert(\"I'm a cat!\");\n    }\n});\n\nMy.Cat.override({\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callOverridden();\n\n        alert(\"Meeeeoooowwww\");\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
\n
\n

This method has been deprecated

\n

as of 4.1. Use callParent instead.

\n\n
\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callOverridden(arguments)

    \n

Returns

  • Object

    Returns the result of calling the overridden method

    \n
( Array/Arguments args ) : Objectprotected
Call the \"parent\" method of the current method. ...

Call the \"parent\" method of the current method. That is the method previously\noverridden by derivation or by an override (see Ext.define).

\n\n
 Ext.define('My.Base', {\n     constructor: function (x) {\n         this.x = x;\n     },\n\n     statics: {\n         method: function (x) {\n             return x;\n         }\n     }\n });\n\n Ext.define('My.Derived', {\n     extend: 'My.Base',\n\n     constructor: function () {\n         this.callParent([21]);\n     }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x);  // alerts 21\n
\n\n

This can be used with an override as follows:

\n\n
 Ext.define('My.DerivedOverride', {\n     override: 'My.Derived',\n\n     constructor: function (x) {\n         this.callParent([x*2]); // calls original My.Derived constructor\n     }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x);  // now alerts 42\n
\n\n

This also works with static methods.

\n\n
 Ext.define('My.Derived2', {\n     extend: 'My.Base',\n\n     statics: {\n         method: function (x) {\n             return this.callParent([x*2]); // calls My.Base.method\n         }\n     }\n });\n\n alert(My.Base.method(10);     // alerts 10\n alert(My.Derived2.method(10); // alerts 20\n
\n\n

Lastly, it also works with overridden static methods.

\n\n
 Ext.define('My.Derived2Override', {\n     override: 'My.Derived2',\n\n     statics: {\n         method: function (x) {\n             return this.callParent([x*2]); // calls My.Derived2.method\n         }\n     }\n });\n\n alert(My.Derived2.method(10); // now alerts 40\n
\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callParent(arguments)

    \n

Returns

  • Object

    Returns the result of calling the parent method

    \n
Removes all items from the collection. ...

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

\n
Removes all listeners for this object including the managed listeners ...

Removes all listeners for this object including the managed listeners

\n
Removes all managed listeners for this object. ...

Removes all managed listeners for this object.

\n
Creates a shallow copy of this collection ...

Creates a shallow copy of this collection

\n

Returns

Collects unique values of a particular property in this MixedCollection ...

Collects unique values of a particular property in this MixedCollection

\n

Parameters

  • property : String

    The property to collect on

    \n
  • root : String (optional)

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

    \n
  • allowBlank : Boolean (optional)

    Pass true to allow null, undefined or empty string values

    \n

Returns

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

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

\n

Parameters

  • o : Object

    The Object to look for in the collection.

    \n

Returns

  • Boolean

    True if the collection contains the Object as an item.

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

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

\n

Parameters

  • key : String

    The key to look for in the collection.

    \n

Returns

  • Boolean

    True if the collection contains the Object as a key.

    \n
Continue to fire event. ...

Continue to fire event.

\n

Parameters

Creates an event handling function which refires the event from this object as the passed event name. ...

Creates an event handling function which refires the event from this object as the passed event name.

\n

Parameters

  • newName : Object
    \n
  • beginEnd : Array (optional)

    The caller can specify on which indices to slice

    \n

Returns

Returns a regular expression based on the given value and matching options. ...

Returns a regular expression based on the given value and matching options. This is used internally for finding and filtering,\nand by Ext.data.Store.filter

\n

Parameters

  • value : String

    The value to create the regex for. This is escaped using Ext.escapeRe

    \n
  • anyMatch : Boolean

    True to allow any match - no regex start/end line anchors will be added. Defaults to false

    \n
  • caseSensitive : Boolean

    True to make the regex case sensitive (adds 'i' switch to regex). Defaults to false.

    \n
  • exactMatch : Boolean

    True to force exact match (^ and $ characters added to the regex). Defaults to false. Ignored if anyMatch is true.

    \n
Normalizes an array of sorter objects, ensuring that they are all Ext.util.Sorter instances ...

Normalizes an array of sorter objects, ensuring that they are all Ext.util.Sorter instances

\n

Parameters

  • sorters : Object[]

    The sorters array

    \n

Returns

Executes the specified function once for every item in the collection. ...

Executes the specified function once for every item in the collection.\nThe function should return a boolean value.\nReturning false from the function will stop the iteration.

\n

Parameters

  • fn : Function

    The function to execute for each item.

    \n

    Parameters

    • item : Mixed

      The collection item.

      \n
    • index : Number

      The index of item.

      \n
    • len : Number

      Total length of collection.

      \n
  • scope : Object (optional)

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

    \n
Executes the specified function once for every key in the collection, passing each\nkey, and its associated item as th...

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

\n

Parameters

  • fn : Function

    The function to execute for each item.

    \n

    Parameters

    • key : String

      The key of collection item.

      \n
    • item : Mixed

      The collection item.

      \n
    • index : Number

      The index of item.

      \n
    • len : Number

      Total length of collection.

      \n
  • scope : Object (optional)

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

    \n
Enables events fired by this Observable to bubble up an owner hierarchy by calling this.getBubbleTarget() if\npresent. ...

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

\n\n

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

\n\n

Example:

\n\n
Ext.override(Ext.form.field.Base, {\n    //  Add functionality to Field's initComponent to enable the change event to bubble\n    initComponent : Ext.Function.createSequence(Ext.form.field.Base.prototype.initComponent, function() {\n        this.enableBubble('change');\n    }),\n\n    //  We know that we want Field's events to bubble directly to the FormPanel.\n    getBubbleTarget : function() {\n        if (!this.formPanel) {\n            this.formPanel = this.findParentByType('form');\n        }\n        return this.formPanel;\n    }\n});\n\nvar myForm = new Ext.formPanel({\n    title: 'User Details',\n    items: [{\n        ...\n    }],\n    listeners: {\n        change: function() {\n            // Title goes red if form has been modified.\n            myForm.header.setStyle('color', 'red');\n        }\n    }\n});\n
\n

Parameters

  • eventNames : String/String[]

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

    \n
Extracts all of the given property values from the items in the MC. ...

Extracts all of the given property values from the items in the MC. Mainly used as a supporting method for\nfunctions like sum and collect.

\n

Parameters

  • property : String

    The property to extract

    \n
  • root : String (optional)

    'root' property to extract the first argument from. This is used mainly when\nextracting field data from Model instances, where the fields are stored inside the 'data' object

    \n

Returns

  • Array

    The extracted values

    \n
Filters the objects in this collection by a set of Filters, or by a single\nproperty/value pair with optional paramete...

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

\n\n\n
//create a simple store with a few people defined\nvar people = new Ext.util.MixedCollection();\npeople.addAll([\n    {id: 1, age: 25, name: 'Ed'},\n    {id: 2, age: 24, name: 'Tommy'},\n    {id: 3, age: 24, name: 'Arne'},\n    {id: 4, age: 26, name: 'Aaron'}\n]);\n\n//a new MixedCollection containing only the items where age == 24\nvar middleAged = people.filter('age', 24);\n
\n\n

Parameters

  • property : Ext.util.Filter[]/String

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

    \n
  • value : String/RegExp

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

    \n
  • anyMatch : Boolean (optional)

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

    \n

    Defaults to: false

  • caseSensitive : Boolean (optional)

    True for case sensitive comparison.

    \n

    Defaults to: false

Returns

Filter by a function. ...

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

\n

Parameters

  • fn : Function

    The function to be called.

    \n

    Parameters

    • item : Mixed

      The collection item.

      \n
    • key : String

      The key of collection item.

      \n
  • scope : Object (optional)

    The scope (this reference) in\nwhich the function is executed. Defaults to this MixedCollection.

    \n

Returns

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

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

\n

Parameters

  • fn : Function

    The selection function to execute for each item.

    \n

    Parameters

    • item : Mixed

      The collection item.

      \n
    • key : String

      The key of collection item.

      \n
  • scope : Object (optional)

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

    \n

Returns

  • Object

    The first item in the collection which returned true from the selection\nfunction, or null if none was found.

    \n
( 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.

\n

Parameters

  • property : String

    The name of a property on your objects.

    \n
  • value : String/RegExp

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

    \n
  • start : Number (optional)

    The index to start searching at.

    \n

    Defaults to: 0

  • anyMatch : Boolean (optional)

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

    \n

    Defaults to: false

  • caseSensitive : Boolean (optional)

    True for case sensitive comparison.

    \n

    Defaults to: false

Returns

  • Number

    The matched index or -1

    \n
Find the index of the first matching object in this collection by a function. ...

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

\n

Parameters

  • fn : Function

    The function to be called.

    \n

    Parameters

    • item : Mixed

      The collection item.

      \n
    • key : String

      The key of collection item.

      \n
  • scope : Object (optional)

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

    \n
  • start : Number (optional)

    The index to start searching at.

    \n

    Defaults to: 0

Returns

  • Number

    The matched index or -1

    \n
Ext.util.MixedCollection
view source
( Object newItem, [Function sorterFn] ) : Number
Calculates the insertion index of the new item based upon the comparison function passed, or the current sort order. ...

Calculates the insertion index of the new item based upon the comparison function passed, or the current sort order.

\n

Parameters

  • newItem : Object

    The new object to find the insertion position of.

    \n
  • sorterFn : Function (optional)

    The function to sort by. This is the same as the sorting function\npassed to sortBy. It accepts 2 items from this MixedCollection, and returns -1 0, or 1\ndepending on the relative sort positions of the 2 compared items.

    \n\n

    If omitted, a function generated from the currently defined set of\nsorters will be used.

    \n

Returns

  • Number

    The insertion point to add the new item into this MixedCollection at using insert

    \n
Fires the specified event with the passed parameters (minus the event name, plus the options object passed\nto addList...

Fires the specified event with the passed parameters (minus the event name, plus the options object passed\nto addListener).

\n\n

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

\n

Parameters

  • eventName : String

    The name of the event to fire.

    \n
  • args : Object...

    Variable number of parameters are passed to handlers.

    \n

Returns

  • Boolean

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

    \n
Returns the first item in the collection. ...

Returns the first item in the collection.

\n

Returns

  • Object

    the first item in the collection..

    \n
Returns a comparator function which compares two items and returns -1, 0, or 1 depending\non the currently defined set...

Returns a comparator function which compares two items and returns -1, 0, or 1 depending\non the currently defined set of sorters.

\n\n\n

If there are no sorters defined, it returns a function which returns 0 meaning that no sorting will occur.

\n\n
Returns the item associated with the passed key OR index. ...

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

\n

Parameters

Returns

  • Object

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

    \n
Returns the item at the specified index. ...

Returns the item at the specified index.

\n

Parameters

  • index : Number

    The index of the item.

    \n

Returns

  • Object

    The item at the specified index.

    \n
Gets the bubbling parent for an Observable ...

Gets the bubbling parent for an Observable

\n

Returns

Returns the item associated with the passed key. ...

Returns the item associated with the passed key.

\n

Parameters

Returns

  • Object

    The item associated with the passed key.

    \n
...
\n

Parameters

Returns the number of items in the collection. ...

Returns the number of items in the collection.

\n

Returns

  • Number

    the number of items in the collection.

    \n
Gets the first sorter from the sorters collection, excluding\nany groupers that may be in place ...

Gets the first sorter from the sorters collection, excluding\nany groupers that may be in place

\n

Returns

Returns the initial configuration passed to constructor when instantiating\nthis class. ...

Returns the initial configuration passed to constructor when instantiating\nthis class.

\n

Parameters

  • name : String (optional)

    Name of the config option to return.

    \n

Returns

  • Object/Mixed

    The full config object or a single config value\nwhen name parameter specified.

    \n
MixedCollection has a generic way to fetch keys if you implement getKey. ...

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

\n\n
// normal way\nvar mc = new Ext.util.MixedCollection();\nmc.add(someEl.dom.id, someEl);\nmc.add(otherEl.dom.id, otherEl);\n//and so on\n\n// using getKey\nvar mc = new Ext.util.MixedCollection();\nmc.getKey = function(el){\n   return el.dom.id;\n};\nmc.add(someEl);\nmc.add(otherEl);\n\n// or via the constructor\nvar mc = new Ext.util.MixedCollection(false, function(el){\n   return el.dom.id;\n});\nmc.add(someEl);\nmc.add(otherEl);\n
\n\n

Parameters

  • item : Object

    The item for which to find the key.

    \n

Returns

  • Object

    The key for the passed item.

    \n
Returns a range of items in this collection ...

Returns a range of items in this collection

\n

Parameters

  • startIndex : Number (optional)

    The starting index. Defaults to 0.

    \n
  • endIndex : Number (optional)

    The ending index. Defaults to the last item.

    \n

Returns

...
\n

Parameters

Checks to see if this object has any listeners for a specified event, or whether the event bubbles. ...

Checks to see if this object has any listeners for a specified event, or whether the event bubbles. The answer\nindicates whether the event needs firing or not.

\n

Parameters

  • eventName : String

    The name of the event to check for

    \n

Returns

  • Boolean

    true if the event is being listened for or bubbles, else false

    \n
Returns index within the collection of the passed Object. ...

Returns index within the collection of the passed Object.

\n

Parameters

  • o : Object

    The item to find the index of.

    \n

Returns

  • Number

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

    \n
Returns index within the collection of the passed key. ...

Returns index within the collection of the passed key.

\n

Parameters

  • key : String

    The key to find the index of.

    \n

Returns

Initialize configuration for this class. ...

Initialize configuration for this class. a typical example:

\n\n
Ext.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});\n\nvar awesome = new My.awesome.Class({\n    name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\n

Parameters

Returns

Performs initialization of this mixin. ...

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

\n
Inserts an item at the specified index in the collection. ...

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

\n

Parameters

  • index : Number

    The index to insert the item at.

    \n
  • key : String

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

    \n
  • o : Object (optional)

    If the second parameter was a key, the new item.

    \n

Returns

Returns the last item in the collection. ...

Returns the last item in the collection.

\n

Returns

  • Object

    the last item in the collection..

    \n
Shorthand for addManagedListener. ...

Shorthand for addManagedListener.

\n\n

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

\n

Parameters

  • item : Ext.util.Observable/Ext.Element

    The item to which to add a listener/listeners.

    \n\n
  • ename : Object/String

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

    \n\n
  • fn : Function (optional)

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

    \n\n
  • scope : Object (optional)

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

    \n\n
  • opt : Object (optional)

    If the ename parameter was an event name, this is the\naddListener options.

    \n\n
Shorthand for removeManagedListener. ...

Shorthand for removeManagedListener.

\n\n

Removes listeners that were added by the mon method.

\n

Parameters

  • item : Ext.util.Observable/Ext.Element

    The item from which to remove a listener/listeners.

    \n\n
  • ename : Object/String

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

    \n\n
  • fn : Function (optional)

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

    \n\n
  • scope : Object (optional)

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

    \n\n
( String/Object eventName, [Function fn], [Object scope], [Object options] )
Shorthand for addListener. ...

Shorthand for addListener.

\n\n

Appends an event handler to this object. For example:

\n\n
myGridPanel.on(\"mouseover\", this.onMouseOver, this);\n
\n\n

The method also allows for a single argument to be passed which is a config object\ncontaining properties which specify multiple events. For example:

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

One can also specify options for each event handler separately:

\n\n
myGridPanel.on({\n    cellClick: {fn: this.onCellClick, scope: this, single: true},\n    mouseover: {fn: panel.onMouseOver, scope: panel}\n});\n
\n\n

Names of methods in a specified scope may also be used. Note that\nscope MUST be specified to use this option:

\n\n
myGridPanel.on({\n    cellClick: {fn: 'onCellClick', scope: this, single: true},\n    mouseover: {fn: 'onMouseOver', scope: panel}\n});\n
\n

Parameters

  • eventName : String/Object

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

    \n\n
  • fn : Function (optional)

    The method the event invokes, or if scope is specified, the name* of the method within\nthe specified scope. Will be called with arguments\ngiven to fireEvent plus the options parameter described below.

    \n\n
  • scope : Object (optional)

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

    \n\n
  • options : Object (optional)

    An object containing handler configuration.

    \n\n\n\n\n

    Note: Unlike in ExtJS 3.x, the options object will also be passed as the last\nargument to every event handler.

    \n\n\n\n\n

    This object may contain any of the following properties:

    \n\n
    • scope : Object

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

      \n\n
    • delay : Number

      The number of milliseconds to delay the invocation of the handler after the event fires.

      \n\n
    • single : Boolean

      True to add a handler to handle just the next firing of the event, and then remove itself.

      \n\n
    • buffer : Number

      Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed\n by the specified number of milliseconds. If the event fires again within that time,\n the original handler is not invoked, but the new handler is scheduled in its place.

      \n\n
    • target : Ext.util.Observable

      Only call the handler if the event was fired on the target Observable, not if the event\n was bubbled up from a child Observable.

      \n\n
    • element : String

      This option is only valid for listeners bound to Components.\n The name of a Component property which references an element to add a listener to.

      \n\n\n\n\n

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

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

      Combining Options

      \n\n\n\n\n

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

      \n\n\n\n\n

      A delayed, one-time listener.

      \n\n\n\n\n
      myPanel.on('hide', this.handleClick, this, {\n    single: true,\n    delay: 100\n});\n
      \n\n
( Object names, Object callback, Object scope )private
...
\n

Parameters

Prepares a given class for observable instances. ...

Prepares a given class for observable instances. This method is called when a\nclass derives from this class or uses this class as a mixin.

\n

Parameters

  • T : Function

    The class constructor to prepare.

    \n
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.

\n\n

For example if you are extending Grid, you might decide to forward some events from store.\nSo you can do this inside your initComponent:

\n\n
this.relayEvents(this.getStore(), ['load']);\n
\n\n

The grid instance will then have an observable 'load' event which will be passed the\nparameters of the store's load event and any function fired with the grid's load event\nwould have access to the grid using the this keyword.

\n

Parameters

  • origin : Object

    The Observable whose events this object is to relay.

    \n
  • events : String[]

    Array of event names to relay.

    \n
  • prefix : String (optional)

    A common prefix to prepend to the event names. For example:

    \n\n
    this.relayEvents(this.getStore(), ['load', 'clear'], 'store');\n
    \n\n

    Now the grid will forward 'load' and 'clear' events of store as 'storeload' and 'storeclear'.

    \n
Remove an item from the collection. ...

Remove an item from the collection.

\n

Parameters

  • o : Object

    The item to remove.

    \n

Returns

  • Object

    The item removed or false if no item was removed.

    \n
Remove all items in the passed array from the collection. ...

Remove all items in the passed array from the collection.

\n

Parameters

  • items : Array

    An array of items to be removed.

    \n

Returns

Remove an item from a specified index in the collection. ...

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

\n

Parameters

  • index : Number

    The index within the collection of the item to remove.

    \n

Returns

  • Object

    The item removed or false if no item was removed.

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

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

\n

Parameters

  • key : String

    The key of the item to remove.

    \n

Returns

  • Object

    The item removed or false if no item was removed.

    \n
Removes an event handler. ...

Removes an event handler.

\n

Parameters

  • eventName : String

    The type of event the handler was associated with.

    \n\n
  • fn : Function

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

    \n\n
  • scope : Object (optional)

    The scope originally specified for the handler. It must be the same as the\nscope argument specified in the original call to addListener or the listener will not be removed.

    \n\n
Removes listeners that were added by the mon method. ...

Removes listeners that were added by the mon method.

\n

Parameters

  • item : Ext.util.Observable/Ext.Element

    The item from which to remove a listener/listeners.

    \n\n
  • ename : Object/String

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

    \n\n
  • fn : Function (optional)

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

    \n\n
  • scope : Object (optional)

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

    \n\n
Remove a single managed listener item ...

Remove a single managed listener item

\n

Parameters

  • isClear : Boolean

    True if this is being called during a clear

    \n
  • managedListener : Object

    The managed listener item\nSee removeManagedListener for other args

    \n
Ext.util.MixedCollection
view source
( Object mapping )
Reorders each of the items based on a mapping from old index to new index. ...

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

\n

Parameters

  • mapping : Object

    Mapping from old item index to new item index

    \n
Replaces an item in the collection. ...

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

\n

Parameters

  • key : String

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

    \n\n\n

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

    \n\n
  • o : Object

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

    \n

Returns

Resumes firing events (see suspendEvents). ...

Resumes firing events (see suspendEvents).

\n\n

If events were suspended using the queueSuspended parameter, then all events fired\nduring event suspension will be sent to any listeners now.

\n
( Object config, Object applyIfNotSet )private
...
\n

Parameters

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

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

\n\n
//sort by a single field\nmyStore.sort('myField', 'DESC');\n\n//sorting by multiple fields\nmyStore.sort([\n    {\n        property : 'age',\n        direction: 'ASC'\n    },\n    {\n        property : 'name',\n        direction: 'DESC'\n    }\n]);\n
\n\n

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

\n\n

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

\n\n
store.sort('myField');\nstore.sort('myField');\n
\n\n

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

\n\n
store.sort('myField', 'ASC');\nstore.sort('myField', 'DESC');\n
\n

Parameters

  • sorters : String/Ext.util.Sorter[] (optional)

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

    \n
  • direction : String (optional)

    The overall direction to sort the data by.

    \n

    Defaults to: "ASC"

Returns

Ext.util.MixedCollection
view source
( Function sorterFn )
Sorts the collection by a single sorter function ...

Sorts the collection by a single sorter function

\n

Parameters

  • sorterFn : Function

    The function to sort by

    \n
Ext.util.MixedCollection
view source
( [String direction], [Function fn] )
Sorts this collection by keys. ...

Sorts this collection by keys.

\n

Parameters

  • direction : String (optional)

    'ASC' or 'DESC'. Defaults to 'ASC'.

    \n
  • fn : Function (optional)

    Comparison function that defines the sort order.\nDefaults to sorting by case insensitive string.

    \n
Get the reference to the class from which this object was instantiated. ...

Get 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

\n\n
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\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
\n

Returns

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

\n

Parameters

  • property : String

    The property to sum by

    \n
  • root : String (optional)

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

    \n
  • start : Number (optional)

    The record index to start at

    \n

    Defaults to: 0

  • end : Number (optional)

    The record index to end at

    \n

    Defaults to: -1

Returns

Suspends the firing of all events. ...

Suspends the firing of all events. (see resumeEvents)

\n

Parameters

  • queueSuspended : Boolean

    Pass as true to queue up suspended events to be fired\nafter the resumeEvents call instead of discarding all suspended events.

    \n
Shorthand for removeListener. ...

Shorthand for removeListener.

\n\n

Removes an event handler.

\n

Parameters

  • eventName : String

    The type of event the handler was associated with.

    \n\n
  • fn : Function

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

    \n\n
  • scope : Object (optional)

    The scope originally specified for the handler. It must be the same as the\nscope argument specified in the original call to addListener or the listener will not be removed.

    \n\n
Defined By

Static Methods

( Object config )privatestatic
...
\n

Parameters

...
\n

Parameters

( Object name, Object member )privatestatic
...
\n

Parameters

Add methods / properties to the prototype of this class. ...

Add methods / properties to the prototype of this class.

\n\n
Ext.define('My.awesome.Cat', {\n    constructor: function() {\n        ...\n    }\n});\n\n My.awesome.Cat.addMembers({\n     meow: function() {\n        alert('Meowww...');\n     }\n });\n\n var kitty = new My.awesome.Cat;\n kitty.meow();\n
\n

Parameters

Add / override static properties of this class. ...

Add / override static properties of this class.

\n\n
Ext.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
\n

Parameters

Returns

( Object xtype )privatestatic
...
\n

Parameters

( Ext.Base fromClass, Array/String members ) : Ext.Baseprivatestatic
Borrow another class' members to the prototype of this class. ...

Borrow another class' members to the prototype of this class.

\n\n
Ext.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
\n

Parameters

  • fromClass : Ext.Base

    The class to borrow members from

    \n
  • members : Array/String

    The names of the members to borrow

    \n

Returns

Create a new instance of this Class. ...

Create a new instance of this Class.

\n\n
Ext.define('My.cool.Class', {\n    ...\n});\n\nMy.cool.Class.create({\n    someConfig: true\n});\n
\n\n

All parameters are passed to the constructor of the class.

\n

Returns

Create aliases for existing prototype methods. ...

Create aliases for existing prototype methods. Example:

\n\n
Ext.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
\n

Parameters

( Object config )privatestatic
...
\n

Parameters

Get the current class' name in string format. ...

Get the current class' name in string format.

\n\n
Ext.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
\n

Returns

( )deprecatedstatic
Adds members to class. ...

Adds members to class.

\n
\n

This method has been deprecated since 4.1

\n

Use addMembers instead.

\n\n
\n
( Object name, Object mixinClass )privatestatic
Used internally by the mixins pre-processor ...

Used internally by the mixins pre-processor

\n

Parameters

( Object fn, Object scope )privatestatic
...
\n

Parameters

( Object members ) : Ext.Basedeprecatedstatic
Override members of this class. ...

Override members of this class. Overridden methods can be invoked via\ncallParent.

\n\n
Ext.define('My.Cat', {\n    constructor: function() {\n        alert(\"I'm a cat!\");\n    }\n});\n\nMy.Cat.override({\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callParent(arguments);\n\n        alert(\"Meeeeoooowwww\");\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
\n\n

As of 4.1, direct use of this method is deprecated. Use Ext.define\ninstead:

\n\n
Ext.define('My.CatOverride', {\n    override: 'My.Cat',\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callParent(arguments);\n\n        alert(\"Meeeeoooowwww\");\n    }\n});\n
\n\n

The above accomplishes the same result but can be managed by the Ext.Loader\nwhich can properly order the override and its target class and the build process\ncan determine whether the override is needed based on the required state of the\ntarget class (My.Cat).

\n
\n

This method has been deprecated since 4.1.0

\n

Use Ext.define instead

\n\n
\n

Parameters

  • members : Object

    The properties to add to this class. This should be\nspecified as an object literal containing one or more properties.

    \n

Returns

Defined By

Events

Fires when an item is added to the collection. ...

Fires when an item is added to the collection.

\n

Parameters

Fires when the collection is cleared. ...

Fires when the collection is cleared.

\n

Parameters

Fires when an item is removed from the collection. ...

Fires when an item is removed from the collection.

\n

Parameters

Fires when an item is replaced in the collection. ...

Fires when an item is replaced in the collection.

\n

Parameters

","subclasses":["Ext.data.Errors","Ext.data.StoreManager","Ext.draw.CompositeSprite","Ext.form.CheckboxManager","Ext.form.RadioManager"],"name":"Ext.util.MixedCollection","alternateClassNames":[],"inheritdoc":null,"files":[{"href":"MixedCollection.html#Ext-util-MixedCollection","filename":"MixedCollection.js"}],"html_meta":{},"singleton":false,"id":"class-Ext.util.MixedCollection","statics":{"property":[{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"property","name":"$onExtended","id":"static-property-S-onExtended"}],"event":[],"css_var":[],"method":[{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"addConfig","id":"static-method-addConfig"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"addInheritableStatics","id":"static-method-addInheritableStatics"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"addMember","id":"static-method-addMember"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"addMembers","id":"static-method-addMembers"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"addStatics","id":"static-method-addStatics"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"addXtype","id":"static-method-addXtype"},{"meta":{"private":true,"static":true},"owner":"Ext.Base","tagname":"method","name":"borrow","id":"static-method-borrow"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"create","id":"static-method-create"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"createAlias","id":"static-method-createAlias"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"extend","id":"static-method-extend"},{"meta":{"static":true},"owner":"Ext.Base","tagname":"method","name":"getName","id":"static-method-getName"},{"meta":{"deprecated":{"text":"Use {@link #addMembers} instead.","version":"4.1"},"static":true},"owner":"Ext.Base","tagname":"method","name":"implement","id":"static-method-implement"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"mixin","id":"static-method-mixin"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"onExtended","id":"static-method-onExtended"},{"meta":{"deprecated":{"text":"Use {@link Ext#define Ext.define} instead","version":"4.1.0"},"markdown":true,"static":true},"owner":"Ext.Base","tagname":"method","name":"override","id":"static-method-override"},{"meta":{"static":true,"private":true},"owner":"Ext.Base","tagname":"method","name":"triggerExtended","id":"static-method-triggerExtended"}],"css_mixin":[],"cfg":[]},"requires":[]});