Ext.data.JsonP.Ext_data_TreeStore({"alternateClassNames":[],"aliases":{"store":["tree"]},"enum":null,"parentMixins":["Ext.util.Observable","Ext.util.Sortable"],"tagname":"class","subclasses":[],"extends":"Ext.data.AbstractStore","uses":[],"html":"
Hierarchy
Ext.BaseExt.data.AbstractStoreExt.data.TreeStoreInherited mixins
Requires
Files
The TreeStore is a store implementation that is backed by by an Ext.data.Tree.\nIt provides convenience methods for loading nodes, as well as the ability to use\nthe hierarchical tree structure combined with a store. This class is generally used\nin conjunction with Ext.tree.Panel. This class also relays many events from\nthe Tree for convenience.
\n\nIf no Model is specified, an implicit model will be created that implements Ext.data.NodeInterface.\nThe standard Tree fields will also be copied onto the Model for maintaining their state. These fields are listed\nin the Ext.data.NodeInterface documentation.
\n\nFor the tree to read nested data, the Ext.data.reader.Reader must be configured with a root property,\nso the reader can find nested data for each node (if a root is not specified, it will default to\n'children'). This will tell the tree to look for any nested tree nodes by the same keyword, i.e., 'children'.\nIf a root is specified in the config make sure that any nested nodes with children have the same name.\nNote that setting defaultRootProperty accomplishes the same thing.
\nIf data is not specified, and if autoLoad is true or an Object, this store's load method is automatically called\nafter creation. If the value of autoLoad is an Object, this Object will be passed to the store's load method.
\nAvailable since: 2.3.0
\nTrue to automatically sync the Store with its Proxy after every edit to one of its Records. Defaults to false.
\nDefaults to: false
Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's\ninternal representation of the data after each operation of the batch has completed, 'complete' will wait until\nthe entire batch has been completed before updating the Store's data. 'complete' is a good choice for local\nstorage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.
\nDefaults to: 'operation'
Remove previously existing child nodes before loading.
\nDefaults to: true
If true
, when a node is reloaded, any records in the removed record collection that were previously descendants of the node being reloaded will be cleared from the removed collection.\nOnly applicable if clearOnLoad is true
.
Defaults to: true
The root property to specify on the reader if one is not explicitly defined.
\nDefaults to: "children"
The default root text (if not specified)/
\nDefaults to: "Root"
The default sort direction to use if one is not specified.
\nDefaults to: "ASC"
This may be used in place of specifying a model configuration. The fields should be a\nset of Ext.data.Field configuration objects. The store will automatically create a Ext.data.Model\nwith these fields. In general this configuration option should only be used for simple stores like\na two-field store of ComboBox. For anything more complicated, such as specifying a particular id property or\nassociations, a Ext.data.Model should be defined and specified for the model\nconfig.
\nAvailable since: 2.3.0
\nIf true, any filters attached to this Store will be run after loading data, before the datachanged event is fired.\nDefaults to true, ignored if remoteFilter is true
\nDefaults to: true
Set to true to automatically prepend a leaf sorter.
\nDefaults to: false
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\nDOM events from Ext JS Components
\n\nWhile 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:
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
\nName of the Model associated with this store.\nThe string is used as an argument for Ext.ModelManager.getModel.
\nThe name of the parameter sent to the server which contains the identifier of the node.
\nDefaults to: "node"
The Proxy to use for this Store. This can be either a string, a config object or a Proxy instance -\nsee setProxy for details.
\nAvailable since: 1.1.0
\nTrue to defer any filtering operation to the server. If false, filtering is done locally on the client.
\nDefaults to: false
True to defer any sorting operation to the server. If false, sorting is done locally on the client.
\nDefaults to: false
The root node for this store. For example:
\n\nroot: {\n expanded: true,\n text: \"My Root\",\n children: [\n { text: \"Child 1\", leaf: true },\n { text: \"Child 2\", expanded: true, children: [\n { text: \"GrandChild\", leaf: true }\n ] }\n ]\n}\n
\n\nSetting the root
config option is the same as calling setRootNode.
If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired.\nDefaults to true, igored if remoteSort is true
\nDefaults to: true
The property in each item that contains the data to sort.
\nThe property in each item that contains the data to sort.
\nConfigure as true
to have the filters saved when a client grid saves its state.
Defaults to: false
Unique identifier for this store. If present, this Store will be registered with the Ext.data.StoreManager,\nmaking it easy to reuse elsewhere.
\n\nNote that when store is instatiated by Controller, the storeId will be overridden by the name of the store.
\nThe string type of the Proxy to create if none is specified. This defaults to creating a\nmemory proxy.
\nDefaults to: 'memory'
Initial suspended call count. Incremented when suspendEvents is called, decremented when resumeEvents is called.
\nDefaults to: 0
If we have no fields declare for the store, add some defaults.\nThese will be ignored if a model is explicitly specified.
\nThis 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\nThe 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
\nTrue if a model was created implicitly for this Store. This happens if a fields array is passed to the Store's\nconstructor instead of a model constructor or name.
\nDefaults to: false
True if the Store has already been destroyed. If this is true, the reference to Store should be deleted\nas it will not function correctly any more.
\nDefaults to: false
Available since: 3.4.0
\ntrue
in this class to identify an object as an instantiated Observable, or subclass thereof.
Defaults to: true
true
in this class to identify an object as an instantiated Sortable, or subclass thereof.
Defaults to: true
true
in this class to identify an object as an instantiated Store, or subclass thereof.
Defaults to: true
A set of default values to be applied to every model instance added via insert or created\nvia createModel. This is used internally by associations to set foreign keys and\nother fields. See the Association classes source code for examples. This should not need to be used by application developers.
\nTemporary cache in which removed model instances are kept until successfully synchronised with a Proxy,\nat which point this is cleared.
\nKeep a copy of the default so we know if it's been changed in a subclass/config
\nDefaults to: 'children'
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
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
\nAdds the specified events to the list of events which this Observable may fire.
\nEither an object with event names as properties with\na value of true
. For example:
this.addEvents({\n storeloaded: true,\n storecleared: true\n});\n
\n\nOr any number of event names as separate parameters. For example:
\n\nthis.addEvents('storeloaded', 'storecleared');\n
\nAppends an event handler to this object. For example:
\n\nmyGridPanel.on(\"mouseover\", this.onMouseOver, this);\n
\n\nThe method also allows for a single argument to be passed which is a config object\ncontaining properties which specify multiple events. For example:
\n\nmyGridPanel.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\nOne can also specify options for each event handler separately:
\n\nmyGridPanel.on({\n cellClick: {fn: this.onCellClick, scope: this, single: true},\n mouseover: {fn: panel.onMouseOver, scope: panel}\n});\n
\n\nNames of methods in a specified scope may also be used. Note that\nscope
MUST be specified to use this option:
myGridPanel.on({\n cellClick: {fn: 'onCellClick', scope: this, single: true},\n mouseover: {fn: 'onMouseOver', scope: panel}\n});\n
\nThe name of the event to listen for.\nMay also be an object who's property names are event names.
\n\nThe 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.
The scope (this
reference) in which the handler function is\nexecuted. If omitted, defaults to the object which fired the event.
An object containing handler configuration.
\n\n\n\n\nNote: Unlike in ExtJS 3.x, the options object will also be passed as the last\nargument to every event handler.
\n\n\n\n\nThis object may contain any of the following properties:
\n\nThe scope (this
reference) in which the handler function is executed. If omitted,\n defaults to the object which fired the event.
The number of milliseconds to delay the invocation of the handler after the event fires.
\n\nTrue to add a handler to handle just the next firing of the event, and then remove itself.
\n\nCauses 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\nOnly 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\nThis 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\nThis 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\nWhen specified as true
, the function returns A Destroyable
object. An object which implements the destroy
method which removes all listeners added in this call.
Defaults to: false
An optional numeric priority that determines the order in which event handlers\n are run. Event handlers with no priority will be run as if they had a priority\n of 0. Handlers with a higher priority will be prioritized to run sooner than\n those with a lower priority. Negative numbers can be used to set a priority\n lower than the default. Internally, the framework uses a range of 1000 or\n greater, and -1000 or lesser for handers that are intended to run before or\n after all others, so it is recommended to stay within the range of -999 to 999\n when setting the priority of event handlers in application-level code.
\n\n\n\n\nCombining Options
\n\n\n\n\nUsing the options argument, it is possible to combine different types of listeners:
\n\n\n\n\nA delayed, one-time listener.
\n\n\n\n\nmyPanel.on('hide', this.handleClick, this, {\n single: true,\n delay: 100\n});\n
\n\nOnly when the destroyable
option is specified.
A Destroyable
object. An object which implements the destroy
method which removes all listeners added in this call. For example:
this.btnListeners = = myButton.on({\n destroyable: true\n mouseover: function() { console.log('mouseover'); },\n mouseout: function() { console.log('mouseout'); },\n click: function() { console.log('click'); }\n});\n
\n\n\n\n\nAnd when those listeners need to be removed:
\n\n\n\n\nExt.destroy(this.btnListeners);\n
\n\n\n\n\nor
\n\n\n\n\nthis.btnListeners.destroy();\n
\n\nAdds listeners to any Observable object (or Ext.Element) which are automatically removed when this Component is\ndestroyed.
\nThe item to which to add a listener/listeners.
\n\nThe event name, or an object containing event name properties.
\n\nIf the ename
parameter was an event name, this is the handler function.
If the ename
parameter was an event name, this is the scope (this
reference)\nin which the handler function is executed.
If the ename
parameter was an event name, this is the\naddListener options.
Only when the destroyable
option is specified.
A Destroyable
object. An object which implements the destroy
method which removes all listeners added in this call. For example:
this.btnListeners = = myButton.mon({\n destroyable: true\n mouseover: function() { console.log('mouseover'); },\n mouseout: function() { console.log('mouseout'); },\n click: function() { console.log('click'); }\n});\n
\n\n\n\n\nAnd when those listeners need to be removed:
\n\n\n\n\nExt.destroy(this.btnListeners);\n
\n\n\n\n\nor
\n\n\n\n\nthis.btnListeners.destroy();\n
\n\nA model instance should call this method on the Store it has been joined to.
\nAvailable since: 3.4.0
\nThe model instance that was edited
\nA model instance should call this method on the Store it has been joined to.
\nAvailable since: 3.4.0
\nThe model instance that was edited
\nArray of field names changed during edit.
\nA model instance should call this method on the Store it has been joined to..
\nAvailable since: 3.4.0
\nThe model instance that was edited
\nCall the original method that was previously overridden with override
\n\nExt.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 This method has been deprecated
\nas of 4.1. Use callParent instead.
\n\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callOverridden(arguments)
Returns the result of calling the overridden method
\nCall 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\nThis 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\nThis 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\nLastly, 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\nTo override a method and replace it and also call the superclass method, use\ncallSuper. This is often done to patch a method to fix a bug.
\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callParent(arguments)
Returns the result of calling the parent method
\nThis method is used by an override to call the superclass method but bypass any\noverridden method. This is often done to \"patch\" a method that contains a bug\nbut for whatever reason cannot be fixed directly.
\n\nConsider:
\n\n Ext.define('Ext.some.Class', {\n method: function () {\n console.log('Good');\n }\n });\n\n Ext.define('Ext.some.DerivedClass', {\n method: function () {\n console.log('Bad');\n\n // ... logic but with a bug ...\n\n this.callParent();\n }\n });\n
\n\nTo patch the bug in DerivedClass.method
, the typical solution is to create an\noverride:
Ext.define('App.paches.DerivedClass', {\n override: 'Ext.some.DerivedClass',\n\n method: function () {\n console.log('Fixed');\n\n // ... logic but with bug fixed ...\n\n this.callSuper();\n }\n });\n
\n\nThe patch method cannot use callParent
to call the superclass method
since\nthat would call the overridden method containing the bug. In other words, the\nabove patch would only produce \"Fixed\" then \"Good\" in the console log, whereas,\nusing callParent
would produce \"Fixed\" then \"Bad\" then \"Good\".
The arguments, either an array or the arguments
object\nfrom the current method, for example: this.callSuper(arguments)
Returns the result of calling the superclass method
\nRemoves all listeners for this object including the managed listeners
\nRemoves all records that used to be descendants of the passed node from the removed array
\nNormalizes an array of filter objects, ensuring that they are all Ext.util.Filter instances
\nThe filters array
\nArray of Ext.util.Filter objects
\nNormalizes an array of sorter objects, ensuring that they are all Ext.util.Sorter instances
\nThe sorters array
\nArray of Ext.util.Sorter objects
\ntells the attached proxy to destroy the given records
\nAvailable since: 3.4.0
\nOverrides: Ext.Base.destroy
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.
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\nExample:
\n\nExt.define('Ext.overrides.form.field.Base', {\n override: 'Ext.form.field.Base',\n\n // Add functionality to Field's initComponent to enable the change event to bubble\n initComponent: function () {\n this.callParent();\n this.enableBubble('change');\n }\n});\n\nvar myForm = Ext.create('Ext.form.Panel', {\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
\nFills a node with a series of child records.
\nThe node to fill
\nThe records to add
\nFires the specified event with the passed parameters (minus the event name, plus the options
object passed\nto addListener).
An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget) by\ncalling enableBubble.
\nThe name of the event to fire.
\nVariable number of parameters are passed to handlers.
\nreturns false if any of the handlers return false otherwise it returns true.
\nFires the specified event with the passed parameter list.
\n\nAn event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget) by\ncalling enableBubble.
\nThe name of the event to fire.
\nAn array of parameters which are passed to handlers.
\nreturns false if any of the handlers return false otherwise it returns true.
\nReturns an object which is passed in as the listeners argument to proxy.batch inside this.sync.\nThis is broken out into a separate function to allow for customisation of the listeners
\nThe listeners object
\nGets the bubbling parent for an Observable
\nThe bubble parent. null is returned if no bubble target exists
\nGets the first sorter from the sorters collection, excluding\nany groupers that may be in place
\nThe sorter, null if none exist
\nGets all records added or updated since the last commit. Note that the order of records\nreturned is not deterministic and does not indicate the order in which records were modified. Note also that\nremoved records are not included (use getRemovedRecords for that).
\nThe added and updated Model instances
\ninherit docs
\n\nReturns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not\nyet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)
\nThe Model instances
\nOverrides: Ext.data.AbstractStore.getNewRecords
Returns the proxy currently attached to this proxy instance
\nThe Proxy instance
\nReturns any records that have been removed from the store but not yet destroyed on the proxy.
\nThe removed Model instances
\nReturns the grouping, sorting and filtered state of this Store.
\ninherit docs
\n\nReturns all Model instances that have been updated in the Store but not yet synchronized with the Proxy
\nThe updated Model instances
\nOverrides: Ext.data.AbstractStore.getUpdatedRecords
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.
\nThe name of the event to check for
\ntrue
if the event is being listened for or bubbles, else false
Initialize configuration for this class. a typical example:
\n\nExt.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
\nthis
\nPerforms initialization of this mixin. Component classes using this mixin should call this method during their\nown initialization.
\nReturns true if the Store is currently performing a load operation
\nTrue if the Store is currently loading
\nLoads the Store using its configured proxy.
\nconfig object. This is passed into the Operation\nobject that is created and then sent to the proxy's Ext.data.proxy.Proxy.read function.\nThe options can also contain a node, which indicates which node is to be loaded. If not specified, it will\ndefault to the root node.
\nOverrides: Ext.data.AbstractStore.load
Shorthand for addManagedListener.
\n\nAdds listeners to any Observable object (or Ext.Element) which are automatically removed when this Component is\ndestroyed.
\nThe item to which to add a listener/listeners.
\n\nThe event name, or an object containing event name properties.
\n\nIf the ename
parameter was an event name, this is the handler function.
If the ename
parameter was an event name, this is the scope (this
reference)\nin which the handler function is executed.
If the ename
parameter was an event name, this is the\naddListener options.
Only when the destroyable
option is specified.
A Destroyable
object. An object which implements the destroy
method which removes all listeners added in this call. For example:
this.btnListeners = = myButton.mon({\n destroyable: true\n mouseover: function() { console.log('mouseover'); },\n mouseout: function() { console.log('mouseout'); },\n click: function() { console.log('click'); }\n});\n
\n\n\n\n\nAnd when those listeners need to be removed:
\n\n\n\n\nExt.destroy(this.btnListeners);\n
\n\n\n\n\nor
\n\n\n\n\nthis.btnListeners.destroy();\n
\n\nShorthand for removeManagedListener.
\n\nRemoves listeners that were added by the mon method.
\nThe item from which to remove a listener/listeners.
\n\nThe event name, or an object containing event name properties.
\n\nIf the ename
parameter was an event name, this is the handler function.
If the ename
parameter was an event name, this is the scope (this
reference)\nin which the handler function is executed.
Shorthand for addListener.
\n\nAppends an event handler to this object. For example:
\n\nmyGridPanel.on(\"mouseover\", this.onMouseOver, this);\n
\n\nThe method also allows for a single argument to be passed which is a config object\ncontaining properties which specify multiple events. For example:
\n\nmyGridPanel.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\nOne can also specify options for each event handler separately:
\n\nmyGridPanel.on({\n cellClick: {fn: this.onCellClick, scope: this, single: true},\n mouseover: {fn: panel.onMouseOver, scope: panel}\n});\n
\n\nNames of methods in a specified scope may also be used. Note that\nscope
MUST be specified to use this option:
myGridPanel.on({\n cellClick: {fn: 'onCellClick', scope: this, single: true},\n mouseover: {fn: 'onMouseOver', scope: panel}\n});\n
\nThe name of the event to listen for.\nMay also be an object who's property names are event names.
\n\nThe 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.
The scope (this
reference) in which the handler function is\nexecuted. If omitted, defaults to the object which fired the event.
An object containing handler configuration.
\n\n\n\n\nNote: Unlike in ExtJS 3.x, the options object will also be passed as the last\nargument to every event handler.
\n\n\n\n\nThis object may contain any of the following properties:
\n\nThe scope (this
reference) in which the handler function is executed. If omitted,\n defaults to the object which fired the event.
The number of milliseconds to delay the invocation of the handler after the event fires.
\n\nTrue to add a handler to handle just the next firing of the event, and then remove itself.
\n\nCauses 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\nOnly 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\nThis 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\nThis 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\nWhen specified as true
, the function returns A Destroyable
object. An object which implements the destroy
method which removes all listeners added in this call.
Defaults to: false
An optional numeric priority that determines the order in which event handlers\n are run. Event handlers with no priority will be run as if they had a priority\n of 0. Handlers with a higher priority will be prioritized to run sooner than\n those with a lower priority. Negative numbers can be used to set a priority\n lower than the default. Internally, the framework uses a range of 1000 or\n greater, and -1000 or lesser for handers that are intended to run before or\n after all others, so it is recommended to stay within the range of -999 to 999\n when setting the priority of event handlers in application-level code.
\n\n\n\n\nCombining Options
\n\n\n\n\nUsing the options argument, it is possible to combine different types of listeners:
\n\n\n\n\nA delayed, one-time listener.
\n\n\n\n\nmyPanel.on('hide', this.handleClick, this, {\n single: true,\n delay: 100\n});\n
\n\nOnly when the destroyable
option is specified.
A Destroyable
object. An object which implements the destroy
method which removes all listeners added in this call. For example:
this.btnListeners = = myButton.on({\n destroyable: true\n mouseover: function() { console.log('mouseover'); },\n mouseout: function() { console.log('mouseout'); },\n click: function() { console.log('click'); }\n});\n
\n\n\n\n\nAnd when those listeners need to be removed:
\n\n\n\n\nExt.destroy(this.btnListeners);\n
\n\n\n\n\nor
\n\n\n\n\nthis.btnListeners.destroy();\n
\n\nFired by the root node.
\n\nCalled before a node is expanded.
\n\nThis ensures that the child nodes are available before calling the passed callback.
\nThe node being expanded.
\nThe function to run after the expand finishes
\nThe scope in which to run the callback function
\nThe extra args to pass to the callback after the new child nodes
\nmay be implemented by store subclasses
\nRemoves any records when a write is returned from the server.
\nThe array of removed records
\nThe operation that just completed
\nTrue if the operation was successful
\nOverrides: Ext.data.AbstractStore.onIdChanged
Callback for any write Operation over the Proxy. Updates the Store's MixedCollection to reflect\nthe updates provided by the Proxy
\nmay be implemented by store subclasses
\nPrepares a given class for observable instances. This method is called when a\nclass derives from this class or uses this class as a mixin.
\nThe class constructor to prepare.
\nRelays selected events from the specified Observable as if the events were fired by this
.
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\nthis.relayEvents(this.getStore(), ['load']);\n
\n\nThe 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.
The Observable whose events this object is to relay.
\nArray of event names to relay.
\nA common prefix to prepend to the event names. For example:
\n\nthis.relayEvents(this.getStore(), ['load', 'clear'], 'store');\n
\n\nNow the grid will forward 'load' and 'clear' events of store as 'storeload' and 'storeclear'.
\nA Destroyable
object. An object which implements the destroy
method which, when destroyed, removes all relayers. For example:
this.storeRelayers = this.relayEvents(this.getStore(), ['load', 'clear'], 'store');\n
\n\nCan be undone by calling
\n\nExt.destroy(this.storeRelayers);\n
\n\nor
\n\nthis.store.relayers.destroy();\n
\ninherit docs
\n\nRemoves all records from the store. This method does a \"fast remove\",\nindividual remove events are not called. The clear event is\nfired upon completion.
\nAvailable since: 1.1.0
\nOverrides: Ext.data.AbstractStore.removeAll
Removes an event handler.
\nThe type of event the handler was associated with.
\n\nThe handler to remove. This must be a reference to the function passed into the\naddListener call.
\n\nThe 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\nRemoves listeners that were added by the mon method.
\nThe item from which to remove a listener/listeners.
\n\nThe event name, or an object containing event name properties.
\n\nIf the ename
parameter was an event name, this is the handler function.
If the ename
parameter was an event name, this is the scope (this
reference)\nin which the handler function is executed.
Resumes automatically syncing the Store with its Proxy. Only applicable if autoSync is true
Resumes firing of the named event(s).
\n\nAfter calling this method to resume events, the events will fire when requested to fire.
\n\nNote that if the suspendEvent method is called multiple times for a certain event,\nthis converse method will have to be called the same number of times for it to resume firing.
\nMultiple event names to resume.
\nResumes firing events (see suspendEvents).
\n\nIf events were suspended using the queueSuspended
parameter, then all events fired\nduring event suspension will be sent to any listeners now.
inherit docs
\n\nSets the Store's Proxy by string, config object or Proxy instance
\nThe new Proxy, which can be either a type string, a configuration object\nor an Ext.data.proxy.Proxy instance
\nThe attached Proxy object
\nOverrides: Ext.data.AbstractStore.setProxy
Sets the root node for this store. See also the root config option.
\nThe new root
\nSorts 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\nInternally, 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\nWhen passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:
\n\nstore.sort('myField');\nstore.sort('myField');\n
\n\nIs equivalent to this code, because Store handles the toggling automatically:
\n\nstore.sort('myField', 'ASC');\nstore.sort('myField', 'DESC');\n
\nEither a string name of one of the fields in this Store's configured\nModel, or an array of sorter configurations.
\nThe overall direction to sort the data by.
\nDefaults to: "ASC"
Sorter function for sorting records in index order
\nGet 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
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
\nSuspends automatically syncing the Store with its Proxy. Only applicable if autoSync is true
Suspends firing of the named event(s).
\n\nAfter calling this method to suspend events, the events will no longer fire when requested to fire.
\n\nNote that if this is called multiple times for a certain event, the converse method\nresumeEvent will have to be called the same number of times for it to resume firing.
\nMultiple event names to suspend.
\nSuspends the firing of all events. (see resumeEvents)
\nPass as true to queue up suspended events to be fired\nafter the resumeEvents call instead of discarding all suspended events.
\nSynchronizes the store with its proxy. This asks the proxy to batch together any new, updated\nand deleted records in the store, updating the store's internal representation of the records\nas each operation completes.
\nObject containing one or more properties supported by the sync method (these get\npassed along to the underlying proxy's batch method):
\nA Ext.data.Batch object (or batch config to apply\nto the created batch). If unspecified a default batch will be auto-created as needed.
\nThe function to be called upon completion of the sync.\nThe callback is called regardless of success or failure and is passed the following parameters:
\nThe batch that was processed,\ncontaining all operations in their current state after processing
\nThe options argument that was originally passed into sync
\nThe function to be called upon successful completion of the sync. The\nsuccess function is called only if no exceptions were reported in any operations. If one or more exceptions\noccurred then the failure function will be called instead. The success function is called\nwith the following parameters:
\nThe batch that was processed,\ncontaining all operations in their current state after processing
\nThe options argument that was originally passed into sync
\nThe function to be called upon unsuccessful completion of the sync. The\nfailure function is called when one or more operations returns an exception during processing (even if some\noperations were also successful). In this case you can check the batch's exceptions array to see exactly which operations had exceptions. The failure function is called with the\nfollowing parameters:
\nThe Ext.data.Batch that was processed, containing all\noperations in their current state after processing
\nThe options argument that was originally passed into sync
\nThe scope in which to execute any callbacks (i.e. the this
object inside\nthe callback, success and/or failure functions). Defaults to the store's proxy.
this
\nShorthand for removeListener.
\n\nRemoves an event handler.
\nThe type of event the handler was associated with.
\n\nThe handler to remove. This must be a reference to the function passed into the\naddListener call.
\n\nThe 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\nAdd methods / properties to the prototype of this class.
\n\nExt.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
\nAdd / override static properties of this class.
\n\nExt.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
\nthis
\nBorrow another class' members to the prototype of this class.
\n\nExt.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
\nThe class to borrow members from
\nThe names of the members to borrow
\nthis
\nCreate aliases for existing prototype methods. Example:
\n\nExt.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
\nThe new method name, or an object to set multiple aliases. See\nflexSetter
\nThe original method name
\nGet the current class' name in string format.
\n\nExt.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
\nclassName
\nAdds members to class.
\nThis method has been deprecated since 4.1
\nUse addMembers instead.
\n\nOverride members of this class. Overridden methods can be invoked via\ncallParent.
\n\nExt.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\nAs of 4.1, direct use of this method is deprecated. Use Ext.define\ninstead:
\n\nExt.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\nThe 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).
\nThis method has been deprecated since 4.1.0
\nUse Ext.define instead
\n\nThe properties to add to this class. This should be\nspecified as an object literal containing one or more properties.
\nthis class
\nFired when a Model instance has been added to this Store.
\nAvailable since: 1.1.0
\nThe store
\nThe Model instances that were added
\nThe index at which the instances were inserted
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires when a new child node is appended
\nThis node
\nThe newly appended node
\nThe index of the newly appended node
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires before a new child is appended, return false to cancel the append.
\nThis node
\nThe child node to be appended
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires before this node is collapsed.
\nThe collapsing node
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires before this node is expanded.
\nThe expanding node
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires before a new child is inserted, return false to cancel the insert.
\nThis node
\nThe child node to be inserted
\nThe child node the node is being inserted before
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires before a request is made for a new data object. If the beforeload handler returns false the load\naction will be canceled.
\nAvailable since: 1.1.0
\nThis Store
\nThe Ext.data.Operation object that will be passed to the Proxy to\nload the Store
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires before this node is moved to a new location in the tree. Return false to cancel the move.
\nThis node
\nThe parent of this node
\nThe new parent this node is moving to
\nThe index it is being moved to
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires before a child is removed, return false to cancel the remove.
\nThis node
\nThe child node to be removed
\ntrue
if the child node is being removed so it can be moved to another position in the tree.\n(a side effect of calling appendChild or\ninsertBefore with a node that already has a parentNode)
The options object passed to Ext.util.Observable.addListener.
\n\n\n\nFired before a call to sync is executed. Return false from any listener to cancel the sync
\nHash of all records to be synchronized, broken down into create, update and destroy
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFired at the end of the remove method when all records in the passed array have been removed.
\n\nIf many records may be removed in one go, then it is more efficient to listen for this event\nand perform any processing for a bulk remove than to listen for many remove events.
\nThe Store object
\nThe array of records that were removed (In the order they appear in the Store)
\nThe indexes of the records that were removed
\ntrue
if the child nodes are being removed so they can be moved to another position in this Store.
The options object passed to Ext.util.Observable.addListener.
\n\n\n\nFired after the removeAll method is called.
\nAvailable since: 1.1.0
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires when this node is collapsed.
\nThe collapsing node
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires whenever the records in the Store have changed in some way - this could include adding or removing\nrecords, or updating the data in existing records
\nAvailable since: 1.1.0
\nThe data store
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires when this node is expanded.
\nThe expanding node
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires when a new child node is inserted.
\nThis node
\nThe child node inserted
\nThe child node the node was inserted before
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires whenever the store reads data from a remote data source.
\nThe node that was loaded.
\nAn array of records.
\nTrue if the operation was successful.
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nOverrides: Ext.data.AbstractStore.load
Fires when this store's underlying reader (available via the proxy) provides new metadata.\nMetadata usually consists of new field definitions, but can include any configuration data\nrequired by an application, and can be processed as needed in the event handler.\nThis event is currently only fired for JsonReaders.
\nAvailable since: 1.1.0
\nThe JSON metadata
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires when this node is moved to a new location in the tree
\nThis node
\nThe old parent of this node
\nThe new parent of this node
\nThe index it was moved to
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires when the data cache has changed in a bulk manner (e.g., it has been sorted, filtered, etc.) and a\nwidget that is using this Store as a Record cache should refresh its view.
\nThe data store
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires when a child node is removed
\nThis node
\nThe removed node
\ntrue
if the child node is being removed so it can be moved to another position in the tree.\n(a side effect of calling appendChild or\ninsertBefore with a node that already has a parentNode)
The options object passed to Ext.util.Observable.addListener.
\n\n\n\nOverrides: Ext.data.AbstractStore.remove
Fires when this node's childNodes are sorted.
\nThis node.
\nThe childNodes of this node.
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires when a Model instance has been updated.
\nAvailable since: 1.1.0
\nThe Model instance that was updated
\nThe update operation being performed. Value may be one of:
\n\nExt.data.Model.EDIT\nExt.data.Model.REJECT\nExt.data.Model.COMMIT\n
\n\n@param {String[]} modifiedFieldNames Array of field names changed during edit.
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\nFires whenever a successful write has been made via the configured Proxy
\nAvailable since: 3.4.0
\nThis Store
\nThe Operation object that was used in\nthe write
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\n