Ext.data.JsonP.Ext_data_proxy_JsonP({"mixins":[],"code_type":"ext_define","inheritable":false,"component":false,"meta":{"author":["Ed Spencer"]},"mixedInto":[],"uses":[],"aliases":{"proxy":["jsonp","scripttag"]},"parentMixins":["Ext.util.Observable"],"superclasses":["Ext.Base","Ext.data.proxy.Proxy","Ext.data.proxy.Server"],"members":{"event":[{"meta":{},"owner":"Ext.data.proxy.JsonP","tagname":"event","name":"exception","id":"event-exception"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"event","name":"metachange","id":"event-metachange"}],"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":{"private":true},"owner":"Ext.util.Observable","tagname":"property","name":"eventsSuspended","id":"property-eventsSuspended"},{"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.Observable","tagname":"property","name":"isObservable","id":"property-isObservable"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"property","name":"isProxy","id":"property-isProxy"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"property","name":"self","id":"property-self"}],"css_var":[],"method":[{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"constructor","id":"method-constructor"},{"meta":{},"owner":"Ext.data.proxy.JsonP","tagname":"method","name":"abort","id":"method-abort"},{"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":{"template":true,"protected":true},"owner":"Ext.data.proxy.Server","tagname":"method","name":"afterRequest","id":"method-afterRequest"},{"meta":{"private":true},"owner":"Ext.data.proxy.Server","tagname":"method","name":"applyEncoding","id":"method-applyEncoding"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"batch","id":"method-batch"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"method","name":"buildRequest","id":"method-buildRequest"},{"meta":{},"owner":"Ext.data.proxy.JsonP","tagname":"method","name":"buildUrl","id":"method-buildUrl"},{"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.Observable","tagname":"method","name":"clearListeners","id":"method-clearListeners"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"clearManagedListeners","id":"method-clearManagedListeners"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"configClass","id":"method-configClass"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"continueFireEvent","id":"method-continueFireEvent"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"create","id":"method-create"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"createRelayer","id":"method-createRelayer"},{"meta":{"private":true},"owner":"Ext.data.proxy.JsonP","tagname":"method","name":"createRequestCallback","id":"method-createRequestCallback"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"destroy","id":"method-destroy"},{"meta":{"private":true},"owner":"Ext.data.proxy.JsonP","tagname":"method","name":"doRequest","id":"method-doRequest"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"enableBubble","id":"method-enableBubble"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"method","name":"encodeFilters","id":"method-encodeFilters"},{"meta":{},"owner":"Ext.data.proxy.JsonP","tagname":"method","name":"encodeRecords","id":"method-encodeRecords"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"method","name":"encodeSorters","id":"method-encodeSorters"},{"meta":{"template":true,"private":true},"owner":"Ext.data.proxy.Server","tagname":"method","name":"extractResponseData","id":"method-extractResponseData"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"fireEvent","id":"method-fireEvent"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"getBubbleParent","id":"method-getBubbleParent"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"getConfig","id":"method-getConfig"},{"meta":{},"owner":"Ext.Base","tagname":"method","name":"getInitialConfig","id":"method-getInitialConfig"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"getModel","id":"method-getModel"},{"meta":{"private":true},"owner":"Ext.data.proxy.Server","tagname":"method","name":"getParams","id":"method-getParams"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"getReader","id":"method-getReader"},{"meta":{"private":true},"owner":"Ext.data.proxy.Server","tagname":"method","name":"getUrl","id":"method-getUrl"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"getWriter","id":"method-getWriter"},{"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":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"initConfig","id":"method-initConfig"},{"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.data.proxy.Proxy","tagname":"method","name":"onBatchComplete","id":"method-onBatchComplete"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"onConfigUpdate","id":"method-onConfigUpdate"},{"meta":{"private":true},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"onMetaChange","id":"method-onMetaChange"},{"meta":{"private":true},"owner":"Ext.util.Observable","tagname":"method","name":"prepareClass","id":"method-prepareClass"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"read","id":"method-read"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"relayEvents","id":"method-relayEvents"},{"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.Observable","tagname":"method","name":"resumeEvents","id":"method-resumeEvents"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"setConfig","id":"method-setConfig"},{"meta":{"private":true},"owner":"Ext.data.proxy.Server","tagname":"method","name":"setException","id":"method-setException"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"method","name":"setExtraParam","id":"method-setExtraParam"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"setModel","id":"method-setModel"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"setReader","id":"method-setReader"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"setWriter","id":"method-setWriter"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"statics","id":"method-statics"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"suspendEvents","id":"method-suspendEvents"},{"meta":{},"owner":"Ext.util.Observable","tagname":"method","name":"un","id":"method-un"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"method","name":"update","id":"method-update"}],"css_mixin":[],"cfg":[{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"api","id":"cfg-api"},{"meta":{},"owner":"Ext.data.proxy.JsonP","tagname":"cfg","name":"autoAppendParams","id":"cfg-autoAppendParams"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"cfg","name":"batchActions","id":"cfg-batchActions"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"cfg","name":"batchOrder","id":"cfg-batchOrder"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"cacheString","id":"cfg-cacheString"},{"meta":{},"owner":"Ext.data.proxy.JsonP","tagname":"cfg","name":"callbackKey","id":"cfg-callbackKey"},{"meta":{"private":true},"owner":"Ext.data.proxy.Proxy","tagname":"cfg","name":"defaultReaderType","id":"cfg-defaultReaderType"},{"meta":{"private":true},"owner":"Ext.data.proxy.Proxy","tagname":"cfg","name":"defaultWriterType","id":"cfg-defaultWriterType"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"directionParam","id":"cfg-directionParam"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"extraParams","id":"cfg-extraParams"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"filterParam","id":"cfg-filterParam"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"groupDirectionParam","id":"cfg-groupDirectionParam"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"groupParam","id":"cfg-groupParam"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"limitParam","id":"cfg-limitParam"},{"meta":{},"owner":"Ext.util.Observable","tagname":"cfg","name":"listeners","id":"cfg-listeners"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"cfg","name":"model","id":"cfg-model"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"noCache","id":"cfg-noCache"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"pageParam","id":"cfg-pageParam"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"cfg","name":"reader","id":"cfg-reader"},{"meta":{},"owner":"Ext.data.proxy.JsonP","tagname":"cfg","name":"recordParam","id":"cfg-recordParam"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"simpleGroupMode","id":"cfg-simpleGroupMode"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"simpleSortMode","id":"cfg-simpleSortMode"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"sortParam","id":"cfg-sortParam"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"startParam","id":"cfg-startParam"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"timeout","id":"cfg-timeout"},{"meta":{},"owner":"Ext.data.proxy.Server","tagname":"cfg","name":"url","id":"cfg-url"},{"meta":{},"owner":"Ext.data.proxy.Proxy","tagname":"cfg","name":"writer","id":"cfg-writer"}]},"tagname":"class","extends":"Ext.data.proxy.Server","html":"

Alternate names

Ext.data.ScriptTagProxy

Hierarchy

Inherited mixins

Requires

Files

The JsonP proxy is useful when you need to load data from a domain other than the one your application is running on. If\nyour application is running on http://domainA.com it cannot use Ajax to load its data\nfrom http://domainB.com because cross-domain ajax requests are prohibited by the browser.

\n\n

We can get around this using a JsonP proxy. JsonP proxy injects a <script> tag into the DOM whenever an AJAX request\nwould usually be made. Let's say we want to load data from http://domainB.com/users - the script tag that would be\ninjected might look like this:

\n\n
<script src=\"http://domainB.com/users?callback=someCallback\"></script>\n
\n\n

When we inject the tag above, the browser makes a request to that url and includes the response as if it was any\nother type of JavaScript include. By passing a callback in the url above, we're telling domainB's server that we want\nto be notified when the result comes in and that it should call our callback function with the data it sends back. So\nlong as the server formats the response to look like this, everything will work:

\n\n
someCallback({\n    users: [\n        {\n            id: 1,\n            name: \"Ed Spencer\",\n            email: \"ed@sencha.com\"\n        }\n    ]\n});\n
\n\n

As soon as the script finishes loading, the 'someCallback' function that we passed in the url is called with the JSON\nobject that the server returned.

\n\n

JsonP proxy takes care of all of this automatically. It formats the url you pass, adding the callback parameter\nautomatically. It even creates a temporary callback function, waits for it to be called and then puts the data into\nthe Proxy making it look just like you loaded it through a normal AjaxProxy. Here's how\nwe might set that up:

\n\n
Ext.define('User', {\n    extend: 'Ext.data.Model',\n    fields: ['id', 'name', 'email']\n});\n\nvar store = Ext.create('Ext.data.Store', {\n    model: 'User',\n    proxy: {\n        type: 'jsonp',\n        url : 'http://domainB.com/users'\n    }\n});\n\nstore.load();\n
\n\n

That's all we need to do - JsonP proxy takes care of the rest. In this case the Proxy will have injected a script tag\nlike this:

\n\n
<script src=\"http://domainB.com/users?callback=callback1\"></script>\n
\n\n

Customization

\n\n

This script tag can be customized using the callbackKey configuration. For example:

\n\n
var store = Ext.create('Ext.data.Store', {\n    model: 'User',\n    proxy: {\n        type: 'jsonp',\n        url : 'http://domainB.com/users',\n        callbackKey: 'theCallbackFunction'\n    }\n});\n\nstore.load();\n
\n\n

Would inject a script tag like this:

\n\n
<script src=\"http://domainB.com/users?theCallbackFunction=callback1\"></script>\n
\n\n

Implementing on the server side

\n\n

The remote server side needs to be configured to return data in this format. Here are suggestions for how you might\nachieve this using Java, PHP and ASP.net:

\n\n

Java:

\n\n
boolean jsonP = false;\nString cb = request.getParameter(\"callback\");\nif (cb != null) {\n    jsonP = true;\n    response.setContentType(\"text/javascript\");\n} else {\n    response.setContentType(\"application/x-json\");\n}\nWriter out = response.getWriter();\nif (jsonP) {\n    out.write(cb + \"(\");\n}\nout.print(dataBlock.toJsonString());\nif (jsonP) {\n    out.write(\");\");\n}\n
\n\n

PHP:

\n\n
$callback = $_REQUEST['callback'];\n\n// Create the output object.\n$output = array('a' => 'Apple', 'b' => 'Banana');\n\n//start output\nif ($callback) {\n    header('Content-Type: text/javascript');\n    echo $callback . '(' . json_encode($output) . ');';\n} else {\n    header('Content-Type: application/x-json');\n    echo json_encode($output);\n}\n
\n\n

ASP.net:

\n\n
String jsonString = \"{success: true}\";\nString cb = Request.Params.Get(\"callback\");\nString responseString = \"\";\nif (!String.IsNullOrEmpty(cb)) {\n    responseString = cb + \"(\" + jsonString + \")\";\n} else {\n    responseString = jsonString;\n}\nResponse.Write(responseString);\n
\n
Defined By

Config options

Specific urls to call on CRUD action methods \"create\", \"read\", \"update\" and \"destroy\". ...

Specific urls to call on CRUD action methods \"create\", \"read\", \"update\" and \"destroy\". Defaults to:

\n\n
api: {\n    create  : undefined,\n    read    : undefined,\n    update  : undefined,\n    destroy : undefined\n}\n
\n\n

The url is built based upon the action being executed [create|read|update|destroy] using the commensurate\napi property, or if undefined default to the configured\nExt.data.Store.url.

\n\n

For example:

\n\n
api: {\n    create  : '/controller/new',\n    read    : '/controller/load',\n    update  : '/controller/update',\n    destroy : '/controller/destroy_action'\n}\n
\n\n

If the specific URL for a given CRUD action is undefined, the CRUD action request will be directed to the\nconfigured url.

\n
Ext.data.proxy.JsonP
view source
: Boolean
True to automatically append the request's params to the generated url. ...

True to automatically append the request's params to the generated url. Defaults to true

\n

Defaults to: true

True to batch actions of a particular type when synchronizing the store. ...

True to batch actions of a particular type when synchronizing the store. Defaults to true.

\n

Defaults to: true

Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. ...

Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. Override this to set a different\norder for the batched CRUD actions to be executed in. Defaults to 'create,update,destroy'.

\n

Defaults to: "create,update,destroy"

The name of the cache param added to the url when using noCache. ...

The name of the cache param added to the url when using noCache. Defaults to \"_dc\".

\n

Defaults to: "_dc"

Ext.data.proxy.JsonP
view source
: String
See Ext.data.JsonP.callbackKey. ...

See Ext.data.JsonP.callbackKey.

\n

Defaults to: "callback"

The default registered reader type. ...

The default registered reader type. Defaults to 'json'.

\n

Defaults to: "json"

The default registered writer type. ...

The default registered writer type. Defaults to 'json'.

\n

Defaults to: "json"

The name of the direction parameter to send in a request. ...

The name of the direction parameter to send in a request. This is only used when simpleSortMode is set to\ntrue. Defaults to 'dir'.

\n

Defaults to: "dir"

Extra parameters that will be included on every request. ...

Extra parameters that will be included on every request. Individual requests with params of the same name\nwill override these params when they are in conflict.

\n
The name of the 'filter' parameter to send in a request. ...

The name of the 'filter' parameter to send in a request. Defaults to 'filter'. Set this to undefined if you don't\nwant to send a filter parameter.

\n

Defaults to: "filter"

The name of the direction parameter to send in a request. ...

The name of the direction parameter to send in a request. This is only used when simpleGroupMode is set to\ntrue. Defaults to 'groupDir'.

\n

Defaults to: "groupDir"

The name of the 'group' parameter to send in a request. ...

The name of the 'group' parameter to send in a request. Defaults to 'group'. Set this to undefined if you don't\nwant to send a group parameter.

\n

Defaults to: "group"

The name of the 'limit' parameter to send in a request. ...

The name of the 'limit' parameter to send in a request. Defaults to 'limit'. Set this to undefined if you don't\nwant to send a limit parameter.

\n

Defaults to: "limit"

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
The name of the Model to tie to this Proxy. ...

The name of the Model to tie to this Proxy. Can be either the string name of the Model, or a reference to the\nModel constructor. Required.

\n
Disable caching by adding a unique parameter name to the request. ...

Disable caching by adding a unique parameter name to the request. Set to false to allow caching. Defaults to true.

\n

Defaults to: true

The name of the 'page' parameter to send in a request. ...

The name of the 'page' parameter to send in a request. Defaults to 'page'. Set this to undefined if you don't\nwant to send a page parameter.

\n

Defaults to: "page"

The Ext.data.reader.Reader to use to decode the server's response or data read from client. ...

The Ext.data.reader.Reader to use to decode the server's response or data read from client. This can either be a\nReader instance, a config object or just a valid Reader type name (e.g. 'json', 'xml').

\n
Ext.data.proxy.JsonP
view source
: String
The param name to use when passing records to the server (e.g. ...

The param name to use when passing records to the server (e.g. 'records=someEncodedRecordString'). Defaults to\n'records'

\n

Defaults to: "records"

Enabling simpleGroupMode in conjunction with remoteGroup will only send one group property and a direction when a\nrem...

Enabling simpleGroupMode in conjunction with remoteGroup will only send one group property and a direction when a\nremote group is requested. The groupDirectionParam and groupParam will be sent with the property name and either 'ASC'\nor 'DESC'.

\n

Defaults to: false

Enabling simpleSortMode in conjunction with remoteSort will only send one sort property and a direction when a\nremote...

Enabling simpleSortMode in conjunction with remoteSort will only send one sort property and a direction when a\nremote sort is requested. The directionParam and sortParam will be sent with the property name\nand either 'ASC' or 'DESC'.

\n

Defaults to: false

The name of the 'sort' parameter to send in a request. ...

The name of the 'sort' parameter to send in a request. Defaults to 'sort'. Set this to undefined if you don't\nwant to send a sort parameter.

\n

Defaults to: "sort"

The name of the 'start' parameter to send in a request. ...

The name of the 'start' parameter to send in a request. Defaults to 'start'. Set this to undefined if you don't\nwant to send a start parameter.

\n

Defaults to: "start"

The number of milliseconds to wait for a response. ...

The number of milliseconds to wait for a response. Defaults to 30000 milliseconds (30 seconds).

\n

Defaults to: 30000

The URL from which to request the data object.

\n

The URL from which to request the data object.

\n
The Ext.data.writer.Writer to use to encode any request sent to the server or saved to client. ...

The Ext.data.writer.Writer to use to encode any request sent to the server or saved to client. This can either be\na Writer instance, a config object or just a valid Writer type name (e.g. 'json', 'xml').

\n

Properties

Defined By

Instance Properties

...
\n

Defaults to: "Ext.Base"

...
\n

Defaults to: {}

Initial suspended call count. ...

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

\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 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 Proxy, or subclass thereof. ...

true in this class to identify an object as an instantiated Proxy, 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
Defined By

Static Properties

...
\n

Defaults to: []

Methods

Defined By

Instance Methods

Creates the Proxy ...

Creates the Proxy

\n

Parameters

  • config : Object (optional)

    Config object.

    \n

Returns

Ext.data.proxy.JsonP
view source
( )
Aborts the current server request if one is currently running ...

Aborts the current server request if one is currently running

\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
Optional callback function which can be used to clean up after a request has been completed. ...

Optional callback function which can be used to clean up after a request has been completed.

\n
\n

This is a template method.\n a hook into the functionality of this class.\n Feel free to override it in child classes.

\n
\n

Parameters

Encode any values being sent to the server. ...

Encode any values being sent to the server. Can be overridden in subclasses.

\n

Parameters

  • An : Array

    array of sorters/filters.

    \n

Returns

Performs a batch of Operations, in the order specified by batchOrder. ...

Performs a batch of Operations, in the order specified by batchOrder. Used\ninternally by Ext.data.Store's sync method. Example usage:

\n\n
myProxy.batch({\n    create : [myModel1, myModel2],\n    update : [myModel3],\n    destroy: [myModel4, myModel5]\n});\n
\n\n

Where the myModel* above are Model instances - in this case 1 and 2 are new instances and\nhave not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been\nsaved but should now be destroyed.

\n\n

Note that the previous version of this method took 2 arguments (operations and listeners). While this is still\nsupported for now, the current signature is now a single options argument that can contain both operations and\nlisteners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.

\n

Parameters

  • options : Object

    Object containing one or more properties supported by the batch method:

    \n
    • operations : Object

      Object containing the Model instances to act upon, keyed by action name

      \n
    • listeners : Object (optional)

      Event listeners object passed straight through to the Batch -\nsee Ext.data.Batch for details

      \n
    • batch : Ext.data.Batch/Object (optional)

      A Ext.data.Batch object (or batch config to apply\nto the created batch). If unspecified a default batch will be auto-created.

      \n
    • callback : Function (optional)

      The function to be called upon completion of processing the batch.\nThe callback is called regardless of success or failure and is passed the following parameters:

      \n

      Parameters

      • batch : Ext.data.Batch

        The batch that was processed,\ncontaining all operations in their current state after processing

        \n
      • options : Object

        The options argument that was originally passed into batch

        \n
    • success : Function (optional)

      The function to be called upon successful completion of the batch. 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:

      \n

      Parameters

      • batch : Ext.data.Batch

        The batch that was processed,\ncontaining all operations in their current state after processing

        \n
      • options : Object

        The options argument that was originally passed into batch

        \n
    • failure : Function (optional)

      The function to be called upon unsuccessful completion of the batch. 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:

      \n

      Parameters

      • batch : Ext.data.Batch

        The batch that was processed,\ncontaining all operations in their current state after processing

        \n
      • options : Object

        The options argument that was originally passed into batch

        \n
    • scope : Object (optional)

      The scope in which to execute any callbacks (i.e. the this object inside\nthe callback, success and/or failure functions). Defaults to the proxy.

      \n

Returns

Creates an Request object from Operation. ...

Creates an Request object from Operation.

\n\n

This gets called from doRequest methods in subclasses of Server proxy.

\n

Parameters

Returns

Ext.data.proxy.JsonP
view source
( Ext.data.Request request ) : String
Generates a url based on a given Ext.data.Request object. ...

Generates a url based on a given Ext.data.Request object. Adds the params and callback function name to the url

\n

Parameters

Returns

Overrides: Ext.data.proxy.Server.buildUrl

( 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 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
Continue to fire event. ...

Continue to fire event.

\n

Parameters

Performs the given create operation. ...

Performs the given create operation.

\n

Parameters

  • operation : Ext.data.Operation

    The Operation to perform

    \n
  • callback : Function

    Callback function to be called when the Operation has completed (whether\nsuccessful or not)

    \n
  • scope : Object

    Scope to execute the callback function in

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

Ext.data.proxy.JsonP
view source
( Ext.data.Request request, Ext.data.Operation operation, Function callback, Object scope ) : Functionprivate
Creates and returns the function that is called when the request has completed. ...

Creates and returns the function that is called when the request has completed. The returned function\nshould accept a Response object, which contains the response to be read by the configured Reader.\nThe third argument is the callback that should be called after the request has been completed and the Reader has decoded\nthe response. This callback will typically be the callback passed by a store, e.g. in proxy.read(operation, theCallback, scope)\ntheCallback refers to the callback argument received by this function.\nSee doRequest for details.

\n

Parameters

  • request : Ext.data.Request

    The Request object

    \n
  • operation : Ext.data.Operation

    The Operation being executed

    \n
  • callback : Function

    The callback function to be called when the request completes. This is usually the callback\npassed to doRequest

    \n
  • scope : Object

    The scope in which to execute the callback function

    \n

Returns

Performs the given destroy operation. ...

Performs the given destroy operation.

\n

Parameters

  • operation : Ext.data.Operation

    The Operation to perform

    \n
  • callback : Function

    Callback function to be called when the Operation has completed (whether\nsuccessful or not)

    \n
  • scope : Object

    Scope to execute the callback function in

    \n

Overrides: Ext.Base.destroy

Ext.data.proxy.JsonP
view source
( Ext.data.Operation operation, Function callback, Object scope )private
Performs the read request to the remote domain. ...

Performs the read request to the remote domain. JsonP proxy does not actually create an Ajax request,\ninstead we write out a <script> tag based on the configuration of the internal Ext.data.Request object

\n

Parameters

Overrides: Ext.data.proxy.Server.doRequest

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
Encodes the array of Ext.util.Filter objects into a string to be sent in the request url. ...

Encodes the array of Ext.util.Filter objects into a string to be sent in the request url. By default,\nthis simply JSON-encodes the filter data

\n

Parameters

Returns

Ext.data.proxy.JsonP
view source
( Ext.data.Model[] records ) : String
Encodes an array of records into a string suitable to be appended to the script src url. ...

Encodes an array of records into a string suitable to be appended to the script src url. This is broken out into\nits own function so that it can be easily overridden.

\n

Parameters

Returns

  • String

    The encoded records string

    \n
Encodes the array of Ext.util.Sorter objects into a string to be sent in the request url. ...

Encodes the array of Ext.util.Sorter objects into a string to be sent in the request url. By default,\nthis simply JSON-encodes the sorter data

\n

Parameters

Returns

Template method to allow subclasses to specify how to get the response for the reader. ...

Template method to allow subclasses to specify how to get the response for the reader.

\n
\n

This is a template method.\n a hook into the functionality of this class.\n Feel free to override it in child classes.

\n
\n

Parameters

  • response : Object

    The server response

    \n

Returns

  • Object

    The response data to be used by the reader

    \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
Gets the bubbling parent for an Observable ...

Gets the bubbling parent for an Observable

\n

Returns

...
\n

Parameters

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
Returns the model attached to this Proxy ...

Returns the model attached to this Proxy

\n

Returns

Copy any sorters, filters etc into the params so they can be sent over the wire ...

Copy any sorters, filters etc into the params so they can be sent over the wire

\n

Parameters

Returns the reader currently attached to this proxy instance ...

Returns the reader currently attached to this proxy instance

\n

Returns

Get the url for the request taking into account the order of priority,\n- The request\n- The api\n- The url ...

Get the url for the request taking into account the order of priority,\n- The request\n- The api\n- The url

\n

Parameters

Returns

Returns the writer currently attached to this proxy instance ...

Returns the writer currently attached to this proxy instance

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

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
The internal callback that the proxy uses to call any specified user callbacks after completion of a batch ...

The internal callback that the proxy uses to call any specified user callbacks after completion of a batch

\n

Parameters

( Object names, Object callback, Object scope )private
...
\n

Parameters

Called each time the reader's onMetaChange is called so that the proxy can fire the metachange event ...

Called each time the reader's onMetaChange is called so that the proxy can fire the metachange event

\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
Performs the given read operation. ...

Performs the given read operation.

\n

Parameters

  • operation : Ext.data.Operation

    The Operation to perform

    \n
  • callback : Function

    Callback function to be called when the Operation has completed (whether\nsuccessful or not)

    \n
  • scope : Object

    Scope to execute the callback function in

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

Sets up an exception on the operation ...

Sets up an exception on the operation

\n

Parameters

Sets a value in the underlying extraParams. ...

Sets a value in the underlying extraParams.

\n

Parameters

  • name : String

    The key for the new value

    \n
  • value : Object

    The value

    \n
Sets the model associated with this proxy. ...

Sets the model associated with this proxy. This will only usually be called by a Store

\n

Parameters

  • model : String/Ext.data.Model

    The new model. Can be either the model name string,\nor a reference to the model's constructor

    \n
  • setOnStore : Boolean

    Sets the new model on the associated Store, if one is present

    \n
Sets the Proxy's Reader by string, config object or Reader instance ...

Sets the Proxy's Reader by string, config object or Reader instance

\n

Parameters

Returns

Sets the Proxy's Writer by string, config object or Writer instance ...

Sets the Proxy's Writer by string, config object or Writer instance

\n

Parameters

Returns

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

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
Performs the given update operation. ...

Performs the given update operation.

\n

Parameters

  • operation : Ext.data.Operation

    The Operation to perform

    \n
  • callback : Function

    Callback function to be called when the Operation has completed (whether\nsuccessful or not)

    \n
  • scope : Object

    Scope to execute the callback function in

    \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

Ext.data.proxy.JsonP
view source
( Ext.data.proxy.Proxy this, Ext.data.Request request, Ext.data.Operation operation, Object eOpts )
Fires when the server returns an exception ...

Fires when the server returns an exception

\n

Parameters

Overrides: Ext.data.proxy.Server.exception

Fires when this proxy's reader provides new metadata. ...

Fires when this proxy's reader provides new metadata. Metadata usually consists\nof new field definitions, but can include any configuration data required by an\napplication, and can be processed as needed in the event handler.\nThis event is currently only fired for JsonReaders. Note that this event is also\npropagated by Ext.data.Store, which is typically where it would be handled.

\n

Parameters

","subclasses":[],"name":"Ext.data.proxy.JsonP","alternateClassNames":["Ext.data.ScriptTagProxy"],"inheritdoc":null,"files":[{"href":"JsonP2.html#Ext-data-proxy-JsonP","filename":"JsonP.js"}],"html_meta":{"author":null},"singleton":false,"id":"class-Ext.data.proxy.JsonP","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":["Ext.data.JsonP"]});