X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/docs/output/Ext.data.proxy.Ajax.js?ds=sidebyside diff --git a/docs/output/Ext.data.proxy.Ajax.js b/docs/output/Ext.data.proxy.Ajax.js index 6486be17..6dfa6dd7 100644 --- a/docs/output/Ext.data.proxy.Ajax.js +++ b/docs/output/Ext.data.proxy.Ajax.js @@ -1,1530 +1 @@ -Ext.data.JsonP.Ext_data_proxy_Ajax({ - "tagname": "class", - "name": "Ext.data.proxy.Ajax", - "doc": "
AjaxProxy is one of the most widely-used ways of getting data into your application. It uses AJAX requests to \nload data from the server, usually to be placed into a Store. Let's take a look at a typical\nsetup. Here we're going to set up a Store that has an AjaxProxy. To prepare, we'll also set up a \nModel:
\n\n\n\n\nExt.define('User', {\n extend: 'Ext.data.Model',\n fields: ['id', 'name', 'email']\n});\n\n//The Store contains the AjaxProxy as an inline configuration\nvar store = new Ext.data.Store({\n model: 'User',\n proxy: {\n type: 'ajax',\n url : 'users.json'\n }\n});\n\nstore.load();\n
\n\n\n\n\nOur example is going to load user data into a Store, so we start off by defining a Model\nwith the fields that we expect the server to return. Next we set up the Store itself, along with a proxy\nconfiguration. This configuration was automatically turned into an Ext.data.proxy.Ajax instance, with the url we\nspecified being passed into AjaxProxy's constructor. It's as if we'd done this:
\n\n\n\n\nnew Ext.data.proxy.Ajax({\n url: 'users.json',\n model: 'User',\n reader: 'json'\n});\n
\n\n\n\n\nA couple of extra configurations appeared here - model and reader. These are set by default \nwhen we create the proxy via the Store - the Store already knows about the Model, and Proxy's default \nReader is JsonReader.
\n\n\n\n\nNow when we call store.load(), the AjaxProxy springs into action, making a request to the url we configured\n('users.json' in this case). As we're performing a read, it sends a GET request to that url (see actionMethods\nto customize this - by default any kind of read will be sent as a GET request and any kind of write will be sent as a\nPOST request).
\n\n\n\n\nLimitations
\n\n\n\n\nAjaxProxy cannot be used to retrieve data from other domains. If your application is running on http://domainA.com\nit cannot load data from http://domainB.com because browsers have a built-in security policy that prohibits domains\ntalking to each other via AJAX.
\n\n\n\n\nIf you need to read data from another domain and can't set up a proxy server (some software that runs on your own\ndomain's web server and transparently forwards requests to http://domainB.com, making it look like they actually came\nfrom http://domainA.com), you can use Ext.data.proxy.JsonP and a technique known as JSON-P (JSON with \nPadding), which can help you get around the problem so long as the server on http://domainB.com is set up to support\nJSON-P responses. See JsonPProxy's introduction docs for more details.
\n\n\n\n\nReaders and Writers
\n\n\n\n\nAjaxProxy can be configured to use any type of Reader to decode the server's response. If\nno Reader is supplied, AjaxProxy will default to using a JsonReader. Reader configuration\ncan be passed in as a simple object, which the Proxy automatically turns into a Reader\ninstance:
\n\n\n\n\nvar proxy = new Ext.data.proxy.Ajax({\n model: 'User',\n reader: {\n type: 'xml',\n root: 'users'\n }\n});\n\nproxy.getReader(); //returns an XmlReader instance based on the config we supplied\n
\n\n\n\n\nUrl generation
\n\n\n\n\nAjaxProxy automatically inserts any sorting, filtering, paging and grouping options into the url it generates for\neach request. These are controlled with the following configuration options:
\n\n\n\n\nEach request sent by AjaxProxy is described by an Operation. To see how we can \ncustomize the generated urls, let's say we're loading the Proxy with the following Operation:
\n\n\n\n\nvar operation = new Ext.data.Operation({\n action: 'read',\n page : 2\n});\n
\n\n\n\n\nNow we'll issue the request for this Operation by calling read:
\n\n\n\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users'\n});\n\nproxy.read(operation); //GET /users?page=2\n
\n\n\n\n\nEasy enough - the Proxy just copied the page property from the Operation. We can customize how this page data is\nsent to the server:
\n\n\n\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users',\n pagePage: 'pageNumber'\n});\n\nproxy.read(operation); //GET /users?pageNumber=2\n
\n\n\n\n\nAlternatively, our Operation could have been configured to send start and limit parameters instead of page:
\n\n\n\n\nvar operation = new Ext.data.Operation({\n action: 'read',\n start : 50,\n limit : 25\n});\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users'\n});\n\nproxy.read(operation); //GET /users?start=50&limit=25\n
\n\n\n\n\nAgain we can customize this url:
\n\n\n\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users',\n startParam: 'startIndex',\n limitParam: 'limitIndex'\n});\n\nproxy.read(operation); //GET /users?startIndex=50&limitIndex=25\n
\n\n\n\n\nAjaxProxy will also send sort and filter information to the server. Let's take a look at how this looks with a\nmore expressive Operation object:
\n\n\n\n\nvar operation = new Ext.data.Operation({\n action: 'read',\n sorters: [\n new Ext.util.Sorter({\n property : 'name',\n direction: 'ASC'\n }),\n new Ext.util.Sorter({\n property : 'age',\n direction: 'DESC'\n })\n ],\n filters: [\n new Ext.util.Filter({\n property: 'eyeColor',\n value : 'brown'\n })\n ]\n});\n
\n\n\n\n\nThis is the type of object that is generated internally when loading a Store with sorters\nand filters defined. By default the AjaxProxy will JSON encode the sorters and filters, resulting in something like\nthis (note that the url is escaped before sending the request, but is left unescaped here for clarity):
\n\n\n\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users'\n});\n\nproxy.read(operation); //GET /users?sort=[{\"property\":\"name\",\"direction\":\"ASC\"},{\"property\":\"age\",\"direction\":\"DESC\"}]&filter=[{\"property\":\"eyeColor\",\"value\":\"brown\"}]\n
\n\n\n\n\nWe can again customize how this is created by supplying a few configuration options. Let's say our server is set \nup to receive sorting information is a format like \"sortBy=name#ASC,age#DESC\". We can configure AjaxProxy to provide\nthat format like this:
\n\n\n\n\n var proxy = new Ext.data.proxy.Ajax({\n url: '/users',\n sortParam: 'sortBy',\n filterParam: 'filterBy',\n\n //our custom implementation of sorter encoding - turns our sorters into \"name#ASC,age#DESC\"\n encodeSorters: function(sorters) {\n var length = sorters.length,\n sortStrs = [],\n sorter, i;\n\n for (i = 0; i < length; i++) {\n sorter = sorters[i];\n\n sortStrs[i] = sorter.property + '#' + sorter.direction\n }\n\n return sortStrs.join(\",\");\n }\n });\n\n proxy.read(operation); //GET /users?sortBy=name#ASC,age#DESC&filterBy=[{\"property\":\"eyeColor\",\"value\":\"brown\"}]\n
\n\n\n\n\nWe can also provide a custom encodeFilters function to encode our filters.
\n\n", - "extends": "Ext.data.proxy.Server", - "mixins": [ - - ], - "alternateClassNames": [ - "Ext.data.HttpProxy", - "Ext.data.AjaxProxy" - ], - "xtype": null, - "author": "Ed Spencer", - "docauthor": null, - "singleton": false, - "private": false, - "cfg": [ - { - "tagname": "cfg", - "name": "api", - "member": "Ext.data.proxy.Server", - "type": "Object", - "doc": "Specific urls to call on CRUD action methods \"read\", \"create\", \"update\" and \"destroy\".\nDefaults to:
\n\napi: {\n read : undefined,\n create : undefined,\n update : undefined,\n destroy : undefined\n}\n
\n\n\nThe url is built based upon the action being executed [load|create|save|destroy]\nusing the commensurate api property, or if undefined default to the\nconfigured Ext.data.Store.url.
\n\n\nFor example:
\n\n\napi: {\n load : '/controller/load',\n create : '/controller/new',\n save : '/controller/update',\n destroy : '/controller/destroy_action'\n}\n
\n\n\nIf the specific URL for a given CRUD action is undefined, the CRUD action request\nwill be directed to the configured url.
\n\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 97, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-api", - "shortDoc": "Specific urls to call on CRUD action methods \"read\", \"create\", \"update\" and \"destroy\".\nDefaults to:\n\napi: {\n read ..." - }, - { - "tagname": "cfg", - "name": "batchActions", - "member": "Ext.data.proxy.Proxy", - "type": "Boolean", - "doc": "True to batch actions of a particular type when synchronizing the store.\nDefaults to true.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 64, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-cfg-batchActions" - }, - { - "tagname": "cfg", - "name": "batchOrder", - "member": "Ext.data.proxy.Proxy", - "type": "String", - "doc": "Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. Override this\nto set a different order for the batched CRUD actions to be executed in. Defaults to 'create,update,destroy'
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 57, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-cfg-batchOrder", - "shortDoc": "Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. Override this\nto set a different ord..." - }, - { - "tagname": "cfg", - "name": "cacheString", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The name of the cache param added to the url when using noCache (defaults to \"_dc\")
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 87, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-cacheString" - }, - { - "tagname": "cfg", - "name": "directionParam", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The name of the direction parameter to send in a request. This is only used when simpleSortMode is set to true.\nDefaults to 'dir'.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 69, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-directionParam", - "shortDoc": "The name of the direction parameter to send in a request. This is only used when simpleSortMode is set to true.\nDefau..." - }, - { - "tagname": "cfg", - "name": "extraParams", - "member": "Ext.data.proxy.Server", - "type": "Object", - "doc": "Extra parameters that will be included on every request. Individual requests with params\nof the same name will override these params when they are in conflict.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 143, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-extraParams", - "shortDoc": "Extra parameters that will be included on every request. Individual requests with params\nof the same name will overri..." - }, - { - "tagname": "cfg", - "name": "filterParam", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The name of the 'filter' parameter to send in a request. Defaults to 'filter'. Set\nthis to undefined if you don't want to send a filter parameter
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 63, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-filterParam", - "shortDoc": "The name of the 'filter' parameter to send in a request. Defaults to 'filter'. Set\nthis to undefined if you don't wan..." - }, - { - "tagname": "cfg", - "name": "groupParam", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The name of the 'group' parameter to send in a request. Defaults to 'group'. Set this\nto undefined if you don't want to send a group parameter
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 51, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-groupParam", - "shortDoc": "The name of the 'group' parameter to send in a request. Defaults to 'group'. Set this\nto undefined if you don't want ..." - }, - { - "tagname": "cfg", - "name": "headers", - "member": "Ext.data.proxy.Ajax", - "type": "Object", - "doc": "Any headers to add to the Ajax request. Defaults to undefined.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Ajax.js", - "linenr": 252, - "html_filename": "Ajax2.html", - "href": "Ajax2.html#Ext-data-proxy-Ajax-cfg-headers" - }, - { - "tagname": "cfg", - "name": "limitParam", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The name of the 'limit' parameter to send in a request. Defaults to 'limit'. Set this\nto undefined if you don't want to send a limit parameter
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 45, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-limitParam", - "shortDoc": "The name of the 'limit' parameter to send in a request. Defaults to 'limit'. Set this\nto undefined if you don't want ..." - }, - { - "tagname": "cfg", - "name": "listeners", - "member": "Ext.util.Observable", - "type": "Object", - "doc": "(optional)
A config object containing one or more event handlers to be added to this\nobject during initialization. This should be a valid listeners config object as specified in the\naddListener example for attaching multiple handlers at once.
\n\nDOM events from ExtJs Components
\n\n\nWhile some ExtJs Component classes export selected DOM events (e.g. \"click\", \"mouseover\" etc), this\n\n\n
is usually only done when extra value can be added. For example the DataView's\nclick
event passing the node clicked on. To access DOM\nevents directly from a child element of a Component, we need to specify the element
option to\nidentify the Component property to add a DOM 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
\n\n\n\n",
- "private": false,
- "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js",
- "linenr": 103,
- "html_filename": "Observable.html",
- "href": "Observable.html#Ext-util-Observable-cfg-listeners",
- "shortDoc": "(optional) A config object containing one or more event handlers to be added to this\nobject during initialization. T..."
- },
- {
- "tagname": "cfg",
- "name": "model",
- "member": "Ext.data.proxy.Proxy",
- "type": "String/Ext.data.Model",
- "doc": "The name of the Model to tie to this Proxy. Can be either the string name of\nthe Model, or a reference to the Model constructor. Required.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 82, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-cfg-model", - "shortDoc": "The name of the Model to tie to this Proxy. Can be either the string name of\nthe Model, or a reference to the Model c..." - }, - { - "tagname": "cfg", - "name": "noCache", - "member": "Ext.data.proxy.Server", - "type": "Boolean", - "doc": "(optional) Defaults to true. Disable caching by adding a unique parameter\nname to the request.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 81, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-noCache" - }, - { - "tagname": "cfg", - "name": "pageParam", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The name of the 'page' parameter to send in a request. Defaults to 'page'. Set this to\nundefined if you don't want to send a page parameter
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 33, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-pageParam", - "shortDoc": "The name of the 'page' parameter to send in a request. Defaults to 'page'. Set this to\nundefined if you don't want to..." - }, - { - "tagname": "cfg", - "name": "reader", - "member": "Ext.data.proxy.Server", - "type": "Object/String/Ext.data.reader.Reader", - "doc": "The Ext.data.reader.Reader to use to decode the server's response. This can\neither be a Reader instance, a config object or just a valid Reader type name (e.g. 'json', 'xml').
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 23, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-reader", - "shortDoc": "The Ext.data.reader.Reader to use to decode the server's response. This can\neither be a Reader instance, a config obj..." - }, - { - "tagname": "cfg", - "name": "simpleSortMode", - "member": "Ext.data.proxy.Server", - "type": "Boolean", - "doc": "Enabling simpleSortMode in conjunction with remoteSort will only send one sort property and a direction when a remote sort is requested.\nThe directionParam and sortParam will be sent with the property name and either 'ASC' or 'DESC'
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 75, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-simpleSortMode", - "shortDoc": "Enabling simpleSortMode in conjunction with remoteSort will only send one sort property and a direction when a remote..." - }, - { - "tagname": "cfg", - "name": "sortParam", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The name of the 'sort' parameter to send in a request. Defaults to 'sort'. Set this\nto undefined if you don't want to send a sort parameter
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 57, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-sortParam", - "shortDoc": "The name of the 'sort' parameter to send in a request. Defaults to 'sort'. Set this\nto undefined if you don't want to..." - }, - { - "tagname": "cfg", - "name": "startParam", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The name of the 'start' parameter to send in a request. Defaults to 'start'. Set this\nto undefined if you don't want to send a start parameter
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 39, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-startParam", - "shortDoc": "The name of the 'start' parameter to send in a request. Defaults to 'start'. Set this\nto undefined if you don't want ..." - }, - { - "tagname": "cfg", - "name": "timeout", - "member": "Ext.data.proxy.Server", - "type": "Number", - "doc": "(optional) The number of milliseconds to wait for a response. Defaults to 30 seconds.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 92, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-timeout" - }, - { - "tagname": "cfg", - "name": "url", - "member": "Ext.data.proxy.Server", - "type": "String", - "doc": "The URL from which to request the data object.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 19, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-url" - }, - { - "tagname": "cfg", - "name": "writer", - "member": "Ext.data.proxy.Server", - "type": "Object/String/Ext.data.writer.Writer", - "doc": "The Ext.data.writer.Writer to use to encode any request sent to the server.\nThis can either be a Writer instance, a config object or just a valid Writer type name (e.g. 'json', 'xml').
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 28, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-cfg-writer", - "shortDoc": "The Ext.data.writer.Writer to use to encode any request sent to the server.\nThis can either be a Writer instance, a c..." - } - ], - "method": [ - { - "tagname": "method", - "name": "Ajax", - "member": "Ext.data.proxy.Ajax", - "doc": "Note that if this HttpProxy is being used by a Store, then the\nStore's call to load will override any specified callback and params\noptions. In this case, use the Store's events to modify parameters,\nor react to loading events. The Store's baseParams may also be\nused to pass parameters known at instantiation time.
\n\n\n\n\nIf an options parameter is passed, the singleton Ext.Ajax object will be used to make\nthe request.
\n\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Ajax.js", - "linenr": 1, - "html_filename": "Ajax2.html", - "href": "Ajax2.html#Ext-data-proxy-Ajax-method-constructor", - "shortDoc": "Note that if this HttpProxy is being used by a Store, then the\nStore's call to load will override any specified callb..." - }, - { - "tagname": "method", - "name": "addEvents", - "member": "Ext.util.Observable", - "doc": "Adds the specified events to the list of events which this Observable may fire.
\n", - "params": [ - { - "type": "Object/String", - "name": "o", - "doc": "Either an object with event names as properties with a value of true
\nor the first event name string if multiple event names are being passed as separate parameters.
[additional] Optional additional event names if multiple event names are being passed as separate parameters.\nUsage:
\n\nthis.addEvents('storeloaded', 'storecleared');\n
\n\n",
- "optional": false
- }
- ],
- "return": {
- "type": "void",
- "doc": "\n"
- },
- "private": false,
- "static": false,
- "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js",
- "linenr": 452,
- "html_filename": "Observable.html",
- "href": "Observable.html#Ext-util-Observable-method-addEvents",
- "shortDoc": "Adds the specified events to the list of events which this Observable may fire.
\n" - }, - { - "tagname": "method", - "name": "addListener", - "member": "Ext.util.Observable", - "doc": "Appends an event handler to this object.
\n", - "params": [ - { - "type": "String", - "name": "eventName", - "doc": "The name of the event to listen for. May also be an object who's property names are event names. See
\n", - "optional": false - }, - { - "type": "Function", - "name": "handler", - "doc": "The method the event invokes.
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "(optional) The scope (this
reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.
(optional) An object containing handler configuration.\nproperties. This may contain any of the following properties:
this
reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.This option is useful during Component construction to add DOM event listeners to elements of Components which\nwill exist only after the Component is rendered. For example, to add a click listener to a Panel's body:\n
new Ext.panel.Panel({\n title: 'The title',\n listeners: {\n click: this.handlePanelClick,\n element: 'body'\n }\n});\n
\n\n\nWhen added in this way, the options available are the options applicable to Ext.core.Element.addListener
\n\n\n\nCombining Options
\nUsing the options argument, it is possible to combine different types of listeners:
\n
\nA delayed, one-time listener.\n
myPanel.on('hide', this.handleClick, this, {\nsingle: true,\ndelay: 100\n});
\n\nAttaching multiple handlers in 1 call
\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple events. For example:\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\n", - "optional": true - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 271, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-addListener", - "shortDoc": "
Appends an event handler to this object.
\n" - }, - { - "tagname": "method", - "name": "addManagedListener", - "member": "Ext.util.Observable", - "doc": "Adds listeners to any Observable object (or Element) which are automatically removed when this Component\nis destroyed.\n\n", - "params": [ - { - "type": "Observable/Element", - "name": "item", - "doc": "
The item to which to add a listener/listeners.
\n", - "optional": false - }, - { - "type": "Object/String", - "name": "ename", - "doc": "The event name, or an object containing event name properties.
\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "Optional. If the ename
parameter was an event name, this\nis the handler function.
Optional. If the ename
parameter was an event name, this\nis the scope (this
reference) in which the handler function is executed.
Optional. If the ename
parameter was an event name, this\nis the addListener options.
Adds listeners to any Observable object (or Element) which are automatically removed when this Component\nis destroyed.\n\n" - }, - { - "tagname": "method", - "name": "afterRequest", - "member": "Ext.data.proxy.Server", - "doc": "
Optional callback function which can be used to clean up after a request has been completed.
\n", - "params": [ - { - "type": "Ext.data.Request", - "name": "request", - "doc": "The Request object
\n", - "optional": false - }, - { - "type": "Boolean", - "name": "success", - "doc": "True if the request was successful
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 450, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-method-afterRequest", - "shortDoc": "Optional callback function which can be used to clean up after a request has been completed.
\n" - }, - { - "tagname": "method", - "name": "batch", - "member": "Ext.data.proxy.Proxy", - "doc": "Performs a batch of Operations, in the order specified by batchOrder. Used internally by\nExt.data.Store's sync method. Example usage:
\n\nmyProxy.batch({\n create : [myModel1, myModel2],\n update : [myModel3],\n destroy: [myModel4, myModel5]\n});\n
\n\n\nWhere the myModel* above are Model instances - in this case 1 and 2 are new instances and have not been\nsaved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.
\n", - "params": [ - { - "type": "Object", - "name": "operations", - "doc": "Object containing the Model instances to act upon, keyed by action name
\n", - "optional": false - }, - { - "type": "Object", - "name": "listeners", - "doc": "Optional listeners object passed straight through to the Batch - see Ext.data.Batch
\n", - "optional": false - } - ], - "return": { - "type": "Ext.data.Batch", - "doc": "The newly created Ext.data.Batch object
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 241, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-batch", - "shortDoc": "Performs a batch of Operations, in the order specified by batchOrder. Used internally by\nExt.data.Store's sync method..." - }, - { - "tagname": "method", - "name": "buildRequest", - "member": "Ext.data.proxy.Server", - "doc": "Creates and returns an Ext.data.Request object based on the options passed by the Store\nthat this Proxy is attached to.
\n", - "params": [ - { - "type": "Ext.data.Operation", - "name": "operation", - "doc": "The Operation object to execute
\n", - "optional": false - } - ], - "return": { - "type": "Ext.data.Request", - "doc": "The request object
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 172, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-method-buildRequest", - "shortDoc": "Creates and returns an Ext.data.Request object based on the options passed by the Store\nthat this Proxy is attached to.
\n" - }, - { - "tagname": "method", - "name": "buildUrl", - "member": "Ext.data.proxy.Server", - "doc": "Generates a url based on a given Ext.data.Request object. By default, ServerProxy's buildUrl will\nadd the cache-buster param to the end of the url. Subclasses may need to perform additional modifications\nto the url.
\n", - "params": [ - { - "type": "Ext.data.Request", - "name": "request", - "doc": "The request object
\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "The url
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 399, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-method-buildUrl", - "shortDoc": "Generates a url based on a given Ext.data.Request object. By default, ServerProxy's buildUrl will\nadd the cache-buste..." - }, - { - "tagname": "method", - "name": "capture", - "member": "Ext.util.Observable", - "doc": "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\nbefore the event is fired. If the supplied function returns false,\nthe event will not fire.
\n", - "params": [ - { - "type": "Observable", - "name": "o", - "doc": "The Observable to capture events from.
\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "The function to call when an event is fired.
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "(optional) The scope (this
reference) in which the function is executed. Defaults to the Observable firing the event.
Removes all listeners for this object including the managed listeners
\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 383, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-clearListeners", - "shortDoc": "Removes all listeners for this object including the managed listeners
\n" - }, - { - "tagname": "method", - "name": "clearManagedListeners", - "member": "Ext.util.Observable", - "doc": "Removes all managed listeners for this object.
\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 412, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-clearManagedListeners", - "shortDoc": "Removes all managed listeners for this object.
\n" - }, - { - "tagname": "method", - "name": "create", - "member": "Ext.data.proxy.Proxy", - "doc": "Performs the given create operation.
\n", - "params": [ - { - "type": "Ext.data.Operation", - "name": "operation", - "doc": "The Operation to perform
\n", - "optional": false - }, - { - "type": "Function", - "name": "callback", - "doc": "Callback function to be called when the Operation has completed (whether successful or not)
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "Scope to execute the callback function in
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 205, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-create", - "shortDoc": "Performs the given create operation.
\n" - }, - { - "tagname": "method", - "name": "destroy", - "member": "Ext.data.proxy.Proxy", - "doc": "Performs the given destroy operation.
\n", - "params": [ - { - "type": "Ext.data.Operation", - "name": "operation", - "doc": "The Operation to perform
\n", - "optional": false - }, - { - "type": "Function", - "name": "callback", - "doc": "Callback function to be called when the Operation has completed (whether successful or not)
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "Scope to execute the callback function in
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 232, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-destroy", - "shortDoc": "Performs the given destroy operation.
\n" - }, - { - "tagname": "method", - "name": "doRequest", - "member": "Ext.data.proxy.Server", - "doc": "In ServerProxy subclasses, the create, read, update and destroy methods all pass\nthrough to doRequest. Each ServerProxy subclass must implement the doRequest method - see Ext.data.proxy.JsonP\nand Ext.data.proxy.Ajax for examples. This method carries the same signature as each of the methods that delegate to it.
\n", - "params": [ - { - "type": "Ext.data.Operation", - "name": "operation", - "doc": "The Ext.data.Operation object
\n", - "optional": false - }, - { - "type": "Function", - "name": "callback", - "doc": "The callback function to call when the Operation has completed
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "The scope in which to execute the callback
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 436, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-method-doRequest", - "shortDoc": "In ServerProxy subclasses, the create, read, update and destroy methods all pass\nthrough to doRequest. Each ServerPro..." - }, - { - "tagname": "method", - "name": "enableBubble", - "member": "Ext.util.Observable", - "doc": "Enables events fired by this Observable to bubble up an owner hierarchy by calling\nthis.getBubbleTarget()
if present. There is no implementation in the Observable base class.
This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default\nimplementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to\naccess the required target more quickly.
\n\n\nExample:
\n\n\nExt.override(Ext.form.field.Base, {\n// Add functionality to Field's initComponent to enable the change event to bubble\ninitComponent : 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.\ngetBubbleTarget : function() {\n if (!this.formPanel) {\n this.formPanel = this.findParentByType('form');\n }\n return this.formPanel;\n}\n});\n\nvar myForm = new Ext.formPanel({\ntitle: 'User Details',\nitems: [{\n ...\n}],\nlisteners: {\n change: function() {\n // Title goes red if form has been modified.\n myForm.header.setStyle('color', 'red');\n }\n}\n});\n
\n\n",
- "params": [
- {
- "type": "String/Array",
- "name": "events",
- "doc": "The event name to bubble, or an Array of event names.
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 554, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-enableBubble", - "shortDoc": "Enables events fired by this Observable to bubble up an owner hierarchy by calling\nthis.getBubbleTarget() if present...." - }, - { - "tagname": "method", - "name": "encodeFilters", - "member": "Ext.data.proxy.Server", - "doc": "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", - "params": [ - { - "type": "Array", - "name": "sorters", - "doc": "The array of Filter objects
\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "The encoded filters
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 319, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-method-encodeFilters", - "shortDoc": "Encodes the array of Ext.util.Filter objects into a string to be sent in the request url. By default,\nthis simply JSO..." - }, - { - "tagname": "method", - "name": "encodeSorters", - "member": "Ext.data.proxy.Server", - "doc": "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", - "params": [ - { - "type": "Array", - "name": "sorters", - "doc": "The array of Sorter objects
\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "The encoded sorters
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 298, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-method-encodeSorters", - "shortDoc": "Encodes the array of Ext.util.Sorter objects into a string to be sent in the request url. By default,\nthis simply JSO..." - }, - { - "tagname": "method", - "name": "fireEvent", - "member": "Ext.util.Observable", - "doc": "Fires the specified event with the passed parameters (minus the event name).
\n\n\nAn event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget)\nby calling enableBubble.
\n\n", - "params": [ - { - "type": "String", - "name": "eventName", - "doc": "The name of the event to fire.
\n", - "optional": false - }, - { - "type": "Object...", - "name": "args", - "doc": "Variable number of parameters are passed to handlers.
\n", - "optional": false - } - ], - "return": { - "type": "Boolean", - "doc": "returns false if any of the handlers return false otherwise it returns true.
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 232, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-fireEvent", - "shortDoc": "Fires the specified event with the passed parameters (minus the event name).\n\n\nAn event may be set to bubble up an Ob..." - }, - { - "tagname": "method", - "name": "getMethod", - "member": "Ext.data.proxy.Ajax", - "doc": "Returns the HTTP method name for a given request. By default this returns based on a lookup on actionMethods.
\n", - "params": [ - { - "type": "Ext.data.Request", - "name": "request", - "doc": "The request object
\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "The HTTP method to use (should be one of 'GET', 'POST', 'PUT' or 'DELETE')
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Ajax.js", - "linenr": 281, - "html_filename": "Ajax2.html", - "href": "Ajax2.html#Ext-data-proxy-Ajax-method-getMethod", - "shortDoc": "Returns the HTTP method name for a given request. By default this returns based on a lookup on actionMethods.
\n" - }, - { - "tagname": "method", - "name": "getModel", - "member": "Ext.data.proxy.Proxy", - "doc": "Returns the model attached to this Proxy
\n", - "params": [ - - ], - "return": { - "type": "Ext.data.Model", - "doc": "The model
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 123, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-getModel", - "shortDoc": "Returns the model attached to this Proxy
\n" - }, - { - "tagname": "method", - "name": "getReader", - "member": "Ext.data.proxy.Proxy", - "doc": "Returns the reader currently attached to this proxy instance
\n", - "params": [ - - ], - "return": { - "type": "Ext.data.reader.Reader", - "doc": "The Reader instance
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 162, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-getReader", - "shortDoc": "Returns the reader currently attached to this proxy instance
\n" - }, - { - "tagname": "method", - "name": "getWriter", - "member": "Ext.data.proxy.Proxy", - "doc": "Returns the writer currently attached to this proxy instance
\n", - "params": [ - - ], - "return": { - "type": "Ext.data.writer.Writer", - "doc": "The Writer instance
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 197, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-getWriter", - "shortDoc": "Returns the writer currently attached to this proxy instance
\n" - }, - { - "tagname": "method", - "name": "hasListener", - "member": "Ext.util.Observable", - "doc": "Checks to see if this object has any listeners for a specified event
\n", - "params": [ - { - "type": "String", - "name": "eventName", - "doc": "The name of the event to check for
\n", - "optional": false - } - ], - "return": { - "type": "Boolean", - "doc": "True if the event is being listened for, else false
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 480, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-hasListener", - "shortDoc": "Checks to see if this object has any listeners for a specified event
\n" - }, - { - "tagname": "method", - "name": "observe", - "member": "Ext.util.Observable", - "doc": "Sets observability on the passed class constructor.
\n\nThis makes any event fired on any instance of the passed class also fire a single event through\nthe class allowing for central handling of events on many instances at once.
\n\nUsage:
\n\nExt.util.Observable.observe(Ext.data.Connection);\nExt.data.Connection.on('beforerequest', function(con, options) {\n console.log('Ajax request made to ' + options.url);\n});\n
\n",
- "params": [
- {
- "type": "Function",
- "name": "c",
- "doc": "The class constructor to make observable.
\n", - "optional": false - }, - { - "type": "Object", - "name": "listeners", - "doc": "An object containing a series of listeners to add. See addListener.
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": true, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 69, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-observe", - "shortDoc": "Sets observability on the passed class constructor.\n\nThis makes any event fired on any instance of the passed class a..." - }, - { - "tagname": "method", - "name": "on", - "member": "Ext.util.Observable", - "doc": "Appends an event handler to this object (shorthand for addListener.)
\n", - "params": [ - { - "type": "String", - "name": "eventName", - "doc": "The type of event to listen for
\n", - "optional": false - }, - { - "type": "Function", - "name": "handler", - "doc": "The method the event invokes
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "(optional) The scope (this
reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.
(optional) An object containing handler configuration.
\n", - "optional": true - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 616, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-on", - "shortDoc": "Appends an event handler to this object (shorthand for addListener.)
\n" - }, - { - "tagname": "method", - "name": "processResponse", - "member": "Ext.data.proxy.Server", - "doc": "\n", - "params": [ - { - "type": "Object", - "name": "success", - "doc": "\n", - "optional": false - }, - { - "type": "Object", - "name": "operation", - "doc": "\n", - "optional": false - }, - { - "type": "Object", - "name": "request", - "doc": "\n", - "optional": false - }, - { - "type": "Object", - "name": "response", - "doc": "\n", - "optional": false - }, - { - "type": "Object", - "name": "callback", - "doc": "\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 208, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-method-processResponse", - "shortDoc": "\n" - }, - { - "tagname": "method", - "name": "read", - "member": "Ext.data.proxy.Proxy", - "doc": "Performs the given read operation.
\n", - "params": [ - { - "type": "Ext.data.Operation", - "name": "operation", - "doc": "The Operation to perform
\n", - "optional": false - }, - { - "type": "Function", - "name": "callback", - "doc": "Callback function to be called when the Operation has completed (whether successful or not)
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "Scope to execute the callback function in
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 214, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-read", - "shortDoc": "Performs the given read operation.
\n" - }, - { - "tagname": "method", - "name": "relayEvents", - "member": "Ext.util.Observable", - "doc": "Relays selected events from the specified Observable as if the events were fired by this
.
The Observable whose events this object is to relay.
\n", - "optional": false - }, - { - "type": "Array", - "name": "events", - "doc": "Array of event names to relay.
\n", - "optional": false - }, - { - "type": "Object", - "name": "prefix", - "doc": "\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 520, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-relayEvents", - "shortDoc": "Relays selected events from the specified Observable as if the events were fired by this
.
Removes all added captures from the Observable.
\n", - "params": [ - { - "type": "Observable", - "name": "o", - "doc": "The Observable to release
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": true, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 46, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-releaseCapture", - "shortDoc": "Removes all added captures from the Observable.
\n" - }, - { - "tagname": "method", - "name": "removeListener", - "member": "Ext.util.Observable", - "doc": "Removes an event handler.
\n", - "params": [ - { - "type": "String", - "name": "eventName", - "doc": "The type of event the handler was associated with.
\n", - "optional": false - }, - { - "type": "Function", - "name": "handler", - "doc": "The handler to remove. This must be a reference to the function passed into the addListener call.
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "(optional) The scope originally specified for the handler.
\n", - "optional": true - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 352, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-removeListener", - "shortDoc": "Removes an event handler.
\n" - }, - { - "tagname": "method", - "name": "removeManagedListener", - "member": "Ext.util.Observable", - "doc": "Removes listeners that were added by the mon method.
\n", - "params": [ - { - "type": "Observable|Element", - "name": "item", - "doc": "The item from which to remove a listener/listeners.
\n", - "optional": false - }, - { - "type": "Object|String", - "name": "ename", - "doc": "The event name, or an object containing event name properties.
\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "Optional. If the ename
parameter was an event name, this\nis the handler function.
Optional. If the ename
parameter was an event name, this\nis the scope (this
reference) in which the handler function is executed.
Removes listeners that were added by the mon method.
\n" - }, - { - "tagname": "method", - "name": "resumeEvents", - "member": "Ext.util.Observable", - "doc": "Resume firing events. (see suspendEvents)\nIf events were suspended using the queueSuspended
parameter, then all\nevents fired during event suspension will be sent to any listeners now.
Sets the model associated with this proxy. This will only usually be called by a Store
\n", - "params": [ - { - "type": "String|Ext.data.Model", - "name": "model", - "doc": "The new model. Can be either the model name string,\nor a reference to the model's constructor
\n", - "optional": false - }, - { - "type": "Boolean", - "name": "setOnStore", - "doc": "Sets the new model on the associated Store, if one is present
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 103, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-setModel", - "shortDoc": "Sets the model associated with this proxy. This will only usually be called by a Store
\n" - }, - { - "tagname": "method", - "name": "setReader", - "member": "Ext.data.proxy.Proxy", - "doc": "Sets the Proxy's Reader by string, config object or Reader instance
\n", - "params": [ - { - "type": "String|Object|Ext.data.reader.Reader", - "name": "reader", - "doc": "The new Reader, which can be either a type string, a configuration object\nor an Ext.data.reader.Reader instance
\n", - "optional": false - } - ], - "return": { - "type": "Ext.data.reader.Reader", - "doc": "The attached Reader object
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 131, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-setReader", - "shortDoc": "Sets the Proxy's Reader by string, config object or Reader instance
\n" - }, - { - "tagname": "method", - "name": "setWriter", - "member": "Ext.data.proxy.Proxy", - "doc": "Sets the Proxy's Writer by string, config object or Writer instance
\n", - "params": [ - { - "type": "String|Object|Ext.data.writer.Writer", - "name": "writer", - "doc": "The new Writer, which can be either a type string, a configuration object\nor an Ext.data.writer.Writer instance
\n", - "optional": false - } - ], - "return": { - "type": "Ext.data.writer.Writer", - "doc": "The attached Writer object
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 170, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-setWriter", - "shortDoc": "Sets the Proxy's Writer by string, config object or Writer instance
\n" - }, - { - "tagname": "method", - "name": "suspendEvents", - "member": "Ext.util.Observable", - "doc": "Suspend the firing of all events. (see resumeEvents)
\n", - "params": [ - { - "type": "Boolean", - "name": "queueSuspended", - "doc": "Pass as true to queue up suspended events to be fired\nafter the resumeEvents call instead of discarding all suspended events;
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 490, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-suspendEvents", - "shortDoc": "Suspend the firing of all events. (see resumeEvents)
\n" - }, - { - "tagname": "method", - "name": "un", - "member": "Ext.util.Observable", - "doc": "Removes an event handler (shorthand for removeListener.)
\n", - "params": [ - { - "type": "String", - "name": "eventName", - "doc": "The type of event the handler was associated with.
\n", - "optional": false - }, - { - "type": "Function", - "name": "handler", - "doc": "The handler to remove. This must be a reference to the function passed into the addListener call.
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "(optional) The scope originally specified for the handler.
\n", - "optional": true - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/util/Observable.js", - "linenr": 608, - "html_filename": "Observable.html", - "href": "Observable.html#Ext-util-Observable-method-un", - "shortDoc": "Removes an event handler (shorthand for removeListener.)
\n" - }, - { - "tagname": "method", - "name": "update", - "member": "Ext.data.proxy.Proxy", - "doc": "Performs the given update operation.
\n", - "params": [ - { - "type": "Ext.data.Operation", - "name": "operation", - "doc": "The Operation to perform
\n", - "optional": false - }, - { - "type": "Function", - "name": "callback", - "doc": "Callback function to be called when the Operation has completed (whether successful or not)
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "Scope to execute the callback function in
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Proxy.js", - "linenr": 223, - "html_filename": "Proxy2.html", - "href": "Proxy2.html#Ext-data-proxy-Proxy-method-update", - "shortDoc": "Performs the given update operation.
\n" - } - ], - "property": [ - { - "tagname": "property", - "name": "actionMethods", - "member": "Ext.data.proxy.Ajax", - "type": "Object", - "doc": "Mapping of action name to HTTP request method. In the basic AjaxProxy these are set to 'GET' for 'read' actions and 'POST'\nfor 'create', 'update' and 'destroy' actions. The Ext.data.proxy.Rest maps these to the correct RESTful methods.
\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Ajax.js", - "linenr": 240, - "html_filename": "Ajax2.html", - "href": "Ajax2.html#Ext-data-proxy-Ajax-property-actionMethods", - "shortDoc": "Mapping of action name to HTTP request method. In the basic AjaxProxy these are set to 'GET' for 'read' actions and '..." - } - ], - "event": [ - { - "tagname": "event", - "name": "exception", - "member": "Ext.data.proxy.Server", - "doc": "Fires when the server returns an exception
\n", - "params": [ - { - "type": "Ext.data.proxy.Proxy", - "name": "this", - "doc": "\n", - "optional": false - }, - { - "type": "Object", - "name": "response", - "doc": "The response from the AJAX request
\n", - "optional": false - }, - { - "type": "Ext.data.Operation", - "name": "operation", - "doc": "The operation that triggered request
\n", - "optional": false - } - ], - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Server.js", - "linenr": 132, - "html_filename": "Server.html", - "href": "Server.html#Ext-data-proxy-Server-event-exception", - "shortDoc": "Fires when the server returns an exception
\n" - } - ], - "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/proxy/Ajax.js", - "linenr": 1, - "html_filename": "Ajax2.html", - "href": "Ajax2.html#Ext-data-proxy-Ajax", - "cssVar": [ - - ], - "cssMixin": [ - - ], - "component": false, - "superclasses": [ - "Ext.data.proxy.Proxy", - "Ext.data.proxy.Server" - ], - "subclasses": [ - "Ext.data.proxy.Rest" - ], - "mixedInto": [ - - ], - "allMixins": [ - "Ext.util.Observable" - ] -}); \ No newline at end of file +Ext.data.JsonP.Ext_data_proxy_Ajax({"tagname":"class","html":"Alternate names
Ext.data.HttpProxyExt.data.AjaxProxyHierarchy
Ext.BaseExt.data.proxy.ProxyExt.data.proxy.ServerExt.data.proxy.AjaxMixins
Requires
Files
AjaxProxy is one of the most widely-used ways of getting data into your application. It uses AJAX requests to load\ndata from the server, usually to be placed into a Store. Let's take a look at a typical setup.\nHere we're going to set up a Store that has an AjaxProxy. To prepare, we'll also set up a Model:
\n\nExt.define('User', {\n extend: 'Ext.data.Model',\n fields: ['id', 'name', 'email']\n});\n\n//The Store contains the AjaxProxy as an inline configuration\nvar store = Ext.create('Ext.data.Store', {\n model: 'User',\n proxy: {\n type: 'ajax',\n url : 'users.json'\n }\n});\n\nstore.load();\n
\n\nOur example is going to load user data into a Store, so we start off by defining a Model with\nthe fields that we expect the server to return. Next we set up the Store itself, along with a\nproxy configuration. This configuration was automatically turned into an\nExt.data.proxy.Ajax instance, with the url we specified being passed into AjaxProxy's constructor.\nIt's as if we'd done this:
\n\nnew Ext.data.proxy.Ajax({\n url: 'users.json',\n model: 'User',\n reader: 'json'\n});\n
\n\nA couple of extra configurations appeared here - model and reader. These are set by default when we\ncreate the proxy via the Store - the Store already knows about the Model, and Proxy's default Reader is JsonReader.
\n\nNow when we call store.load(), the AjaxProxy springs into action, making a request to the url we configured\n('users.json' in this case). As we're performing a read, it sends a GET request to that url (see\nactionMethods to customize this - by default any kind of read will be sent as a GET request and any kind of write\nwill be sent as a POST request).
\n\nAjaxProxy cannot be used to retrieve data from other domains. If your application is running on http://domainA.com it\ncannot load data from http://domainB.com because browsers have a built-in security policy that prohibits domains\ntalking to each other via AJAX.
\n\nIf you need to read data from another domain and can't set up a proxy server (some software that runs on your own\ndomain's web server and transparently forwards requests to http://domainB.com, making it look like they actually came\nfrom http://domainA.com), you can use Ext.data.proxy.JsonP and a technique known as JSON-P (JSON with\nPadding), which can help you get around the problem so long as the server on http://domainB.com is set up to support\nJSON-P responses. See JsonPProxy's introduction docs for more details.
\n\nAjaxProxy can be configured to use any type of Reader to decode the server's response.\nIf no Reader is supplied, AjaxProxy will default to using a JsonReader. Reader\nconfiguration can be passed in as a simple object, which the Proxy automatically turns into a Reader instance:
\n\nvar proxy = new Ext.data.proxy.Ajax({\n model: 'User',\n reader: {\n type: 'xml',\n root: 'users'\n }\n});\n\nproxy.getReader(); //returns an XmlReader instance based on the config we supplied\n
\n\nAjaxProxy automatically inserts any sorting, filtering, paging and grouping options into the url it generates for\neach request. These are controlled with the following configuration options:
\n\nEach request sent by AjaxProxy is described by an Operation. To see how we can customize\nthe generated urls, let's say we're loading the Proxy with the following Operation:
\n\nvar operation = new Ext.data.Operation({\n action: 'read',\n page : 2\n});\n
\n\nNow we'll issue the request for this Operation by calling read:
\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users'\n});\n\nproxy.read(operation); //GET /users?page=2\n
\n\nEasy enough - the Proxy just copied the page property from the Operation. We can customize how this page data is sent\nto the server:
\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users',\n pagePage: 'pageNumber'\n});\n\nproxy.read(operation); //GET /users?pageNumber=2\n
\n\nAlternatively, our Operation could have been configured to send start and limit parameters instead of page:
\n\nvar operation = new Ext.data.Operation({\n action: 'read',\n start : 50,\n limit : 25\n});\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users'\n});\n\nproxy.read(operation); //GET /users?start=50&limit;=25\n
\n\nAgain we can customize this url:
\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users',\n startParam: 'startIndex',\n limitParam: 'limitIndex'\n});\n\nproxy.read(operation); //GET /users?startIndex=50&limitIndex;=25\n
\n\nAjaxProxy will also send sort and filter information to the server. Let's take a look at how this looks with a more\nexpressive Operation object:
\n\nvar operation = new Ext.data.Operation({\n action: 'read',\n sorters: [\n new Ext.util.Sorter({\n property : 'name',\n direction: 'ASC'\n }),\n new Ext.util.Sorter({\n property : 'age',\n direction: 'DESC'\n })\n ],\n filters: [\n new Ext.util.Filter({\n property: 'eyeColor',\n value : 'brown'\n })\n ]\n});\n
\n\nThis is the type of object that is generated internally when loading a Store with sorters and\nfilters defined. By default the AjaxProxy will JSON encode the sorters and filters, resulting in something like this\n(note that the url is escaped before sending the request, but is left unescaped here for clarity):
\n\nvar proxy = new Ext.data.proxy.Ajax({\n url: '/users'\n});\n\nproxy.read(operation); //GET /users?sort=[{\"property\":\"name\",\"direction\":\"ASC\"},{\"property\":\"age\",\"direction\":\"DESC\"}]&filter;=[{\"property\":\"eyeColor\",\"value\":\"brown\"}]\n
\n\nWe can again customize how this is created by supplying a few configuration options. Let's say our server is set up\nto receive sorting information is a format like \"sortBy=name#ASC,age#DESC\". We can configure AjaxProxy to provide\nthat format like this:
\n\n var proxy = new Ext.data.proxy.Ajax({\n url: '/users',\n sortParam: 'sortBy',\n filterParam: 'filterBy',\n\n //our custom implementation of sorter encoding - turns our sorters into \"name#ASC,age#DESC\"\n encodeSorters: function(sorters) {\n var length = sorters.length,\n sortStrs = [],\n sorter, i;\n\n for (i = 0; i < length; i++) {\n sorter = sorters[i];\n\n sortStrs[i] = sorter.property + '#' + sorter.direction\n }\n\n return sortStrs.join(\",\");\n }\n });\n\n proxy.read(operation); //GET /users?sortBy=name#ASC,age#DESC&filterBy;=[{\"property\":\"eyeColor\",\"value\":\"brown\"}]\n
\n\nWe can also provide a custom encodeFilters function to encode our filters.
\nSpecific urls to call on CRUD action methods \"create\", \"read\", \"update\" and \"destroy\". Defaults to:
\n\napi: {\n create : undefined,\n read : undefined,\n update : undefined,\n destroy : undefined\n}\n
\n\nThe 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\nFor example:
\n\napi: {\n create : '/controller/new',\n read : '/controller/load',\n update : '/controller/update',\n destroy : '/controller/destroy_action'\n}\n
\n\nIf the specific URL for a given CRUD action is undefined, the CRUD action request will be directed to the\nconfigured url.
\nTrue to batch actions of a particular type when synchronizing the store. Defaults to true.
\nDefaults to: true
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'.
\nDefaults to: "create,update,destroy"
The name of the cache param added to the url when using noCache. Defaults to \"_dc\".
\nDefaults to: "_dc"
The name of the direction parameter to send in a request. This is only used when simpleSortMode is set to\ntrue. Defaults to 'dir'.
\nDefaults to: "dir"
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.
\nThe 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.
\nDefaults to: "filter"
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.
\nDefaults to: "group"
Any headers to add to the Ajax request. Defaults to undefined.
\nThe 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.
\nDefaults to: "limit"
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
\nThe 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.
\nDisable caching by adding a unique parameter name to the request. Set to false to allow caching. Defaults to true.
\nDefaults to: true
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.
\nDefaults to: "page"
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').
\nEnabling 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 and either 'ASC'\nor 'DESC'.
\nDefaults to: false
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.
\nDefaults to: "sort"
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.
\nDefaults to: "start"
The number of milliseconds to wait for a response. Defaults to 30000 milliseconds (30 seconds).
\nDefaults to: 30000
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').
\nMapping of action name to HTTP request method. In the basic AjaxProxy these are set to 'GET' for 'read' actions\nand 'POST' for 'create', 'update' and 'destroy' actions. The Ext.data.proxy.Rest maps these to the\ncorrect RESTful methods.
\nGet 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 return 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
\nNote that if this HttpProxy is being used by a Store, then the Store's call to\nload will override any specified callback and params options. In this case, use the\nStore's events to modify parameters, or react to loading events.
\nConfig object.\nIf an options parameter is passed, the singleton Ext.Ajax object will be used to make the request.
\nAdds the specified events to the list of events which this Observable may fire.
\nEither an object with event names as properties with a value of true
or the first\nevent name string if multiple event names are being passed as separate parameters. Usage:
this.addEvents({\n storeloaded: true,\n storecleared: true\n});\n
\nAdditional event names if multiple event names are being passed as separate\nparameters. Usage:
\n\nthis.addEvents('storeloaded', 'storecleared');\n
\nAppends an event handler to this object.
\nThe name of the event to listen for. May also be an object who's property names are\nevent names.
\n\nThe method the event invokes. Will be called with arguments given to\nfireEvent plus the options
parameter described below.
The scope (this
reference) in which the handler function is executed. If\nomitted, 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 argument to every event handler.
\n\n\n\n\nThis object may contain any of the following properties:
\n\n\n\n\nscope : Object
\n\nThe scope (this
reference) in which the handler function is executed. If omitted, defaults to the object\nwhich fired the event.
delay : Number
\n\nThe number of milliseconds to delay the invocation of the handler after the event fires.
single : Boolean
\n\nTrue to add a handler to handle just the next firing of the event, and then remove itself.
buffer : Number
\n\nCauses the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of\nmilliseconds. If the event fires again within that time, the original handler is not invoked, but the new\nhandler is scheduled in its place.
target : Observable
\n\nOnly call the handler if the event was fired on the target Observable, not if the event was bubbled up from a\nchild Observable.
element : String
\n\nThis option is only valid for listeners bound to Components. The name of a Component\nproperty which references an element to add a listener to.
\n\nThis option is useful during Component construction to add DOM event listeners to elements of\nComponents which will exist only after the Component is rendered.\nFor example, to add a click listener to a Panel's body:
\n\nnew Ext.panel.Panel({\n title: 'The title',\n listeners: {\n click: this.handlePanelClick,\n element: 'body'\n }\n});\n
Combining 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\n\n\n\nAttaching multiple handlers in 1 call
\n\n\n\n\nThe method also allows for a single argument to be passed which is a config object containing properties which\nspecify multiple events. For example:
\n\n\n\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\n\n\n\nOne can also specify options for each event handler separately:
\n\n\n\n\nmyGridPanel.on({\n cellClick: {fn: this.onCellClick, scope: this, single: true},\n mouseover: {fn: panel.onMouseOver, scope: panel}\n});\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.
Optional callback function which can be used to clean up after a request has been completed.
\nThe Request object
\nTrue if the request was successful
\nPerforms a batch of Operations, in the order specified by batchOrder. Used\ninternally by Ext.data.Store's sync method. Example usage:
\n\nmyProxy.batch({\n create : [myModel1, myModel2],\n update : [myModel3],\n destroy: [myModel4, myModel5]\n});\n
\n\nWhere 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.
\nObject containing the Model instances to act upon, keyed by action name
\nlisteners object passed straight through to the Batch -\nsee Ext.data.Batch
\nThe newly created Ext.data.Batch object
\nCreates and returns an Ext.data.Request object based on the options passed by the Store\nthat this Proxy is attached to.
\nThe Operation object to execute
\nThe request object
\nGenerates a url based on a given Ext.data.Request object. By default, ServerProxy's buildUrl will add the\ncache-buster param to the end of the url. Subclasses may need to perform additional modifications to the url.
\nThe request object
\nThe url
\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 return this;\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n var instance = this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n\n return instance;\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
\nThe arguments, either an array or the arguments
object
Returns the result after calling the overridden method
\nCall the parent's overridden method. For example:
\n\nExt.define('My.own.A', {\n constructor: function(test) {\n alert(test);\n }\n});\n\nExt.define('My.own.B', {\n extend: 'My.own.A',\n\n constructor: function(test) {\n alert(test);\n\n this.callParent([test + 1]);\n }\n});\n\nExt.define('My.own.C', {\n extend: 'My.own.B',\n\n constructor: function() {\n alert(\"Going to call parent's overriden constructor...\");\n\n this.callParent(arguments);\n }\n});\n\nvar a = new My.own.A(1); // alerts '1'\nvar b = new My.own.B(1); // alerts '1', then alerts '2'\nvar c = new My.own.C(2); // alerts \"Going to call parent's overriden constructor...\"\n // alerts '2', then alerts '3'\n
\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callParent(arguments)
Returns the result from the superclass' method
\nRemoves all listeners for this object including the managed listeners
\nPerforms the given create operation.
\nThe Operation to perform
\nCallback function to be called when the Operation has completed (whether successful or not)
\nScope to execute the callback function in
\nPerforms the given destroy operation.
\nThe Operation to perform
\nCallback function to be called when the Operation has completed (whether successful or not)
\nScope to execute the callback function in
\nIn ServerProxy subclasses, the create, read, update and destroy methods all\npass through to doRequest. Each ServerProxy subclass must implement the doRequest method - see Ext.data.proxy.JsonP and Ext.data.proxy.Ajax for examples. This method carries the same signature as\neach of the methods that delegate to it.
\nThe Ext.data.Operation object
\nThe callback function to call when the Operation has completed
\nThe scope in which to execute the callback
\nEnables 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.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
\nEncodes 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
\nThe array of Filter objects
\nThe encoded filters
\nEncodes 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
\nThe array of Sorter objects
\nThe encoded sorters
\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.
\nReturns the HTTP method name for a given request. By default this returns based on a lookup on\nactionMethods.
\nThe request object
\nThe HTTP method to use (should be one of 'GET', 'POST', 'PUT' or 'DELETE')
\nReturns the reader currently attached to this proxy instance
\nThe Reader instance
\nReturns the writer currently attached to this proxy instance
\nThe Writer instance
\nInitialize 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 return this;\n }\n});\n\nvar awesome = new My.awesome.Class({\n name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\nmixins The mixin prototypes as key - value pairs
\nShorthand 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.
Shorthand 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.
\nThe name of the event to listen for. May also be an object who's property names are\nevent names.
\n\nThe method the event invokes. Will be called with arguments given to\nfireEvent plus the options
parameter described below.
The scope (this
reference) in which the handler function is executed. If\nomitted, 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 argument to every event handler.
\n\n\n\n\nThis object may contain any of the following properties:
\n\n\n\n\nscope : Object
\n\nThe scope (this
reference) in which the handler function is executed. If omitted, defaults to the object\nwhich fired the event.
delay : Number
\n\nThe number of milliseconds to delay the invocation of the handler after the event fires.
single : Boolean
\n\nTrue to add a handler to handle just the next firing of the event, and then remove itself.
buffer : Number
\n\nCauses the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of\nmilliseconds. If the event fires again within that time, the original handler is not invoked, but the new\nhandler is scheduled in its place.
target : Observable
\n\nOnly call the handler if the event was fired on the target Observable, not if the event was bubbled up from a\nchild Observable.
element : String
\n\nThis option is only valid for listeners bound to Components. The name of a Component\nproperty which references an element to add a listener to.
\n\nThis option is useful during Component construction to add DOM event listeners to elements of\nComponents which will exist only after the Component is rendered.\nFor example, to add a click listener to a Panel's body:
\n\nnew Ext.panel.Panel({\n title: 'The title',\n listeners: {\n click: this.handlePanelClick,\n element: 'body'\n }\n});\n
Combining 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\n\n\n\nAttaching multiple handlers in 1 call
\n\n\n\n\nThe method also allows for a single argument to be passed which is a config object containing properties which\nspecify multiple events. For example:
\n\n\n\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\n\n\n\nOne can also specify options for each event handler separately:
\n\n\n\n\nmyGridPanel.on({\n cellClick: {fn: this.onCellClick, scope: this, single: true},\n mouseover: {fn: panel.onMouseOver, scope: panel}\n});\n
\n\nPerforms the given read operation.
\nThe Operation to perform
\nCallback function to be called when the Operation has completed (whether successful or not)
\nScope to execute the callback function in
\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\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 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.
Sets the model associated with this proxy. This will only usually be called by a Store
\nThe new model. Can be either the model name string,\nor a reference to the model's constructor
\nSets the new model on the associated Store, if one is present
\nSets the Proxy's Reader by string, config object or Reader instance
\nThe new Reader, which can be either a type string,\na configuration object or an Ext.data.reader.Reader instance
\nThe attached Reader object
\nSets the Proxy's Writer by string, config object or Writer instance
\nThe new Writer, which can be either a type string,\na configuration object or an Ext.data.writer.Writer instance
\nThe attached Writer object
\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 return this;\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 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.
\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\nPerforms the given update operation.
\nThe Operation to perform
\nCallback function to be called when the Operation has completed (whether successful or not)
\nScope to execute the callback function in
\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 a new instance of this Class.
\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.create({\n someConfig: true\n});\n
\n\nAll parameters are passed to the constructor of the class.
\nthe created instance.
\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
\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.implement({\n meow: function() {\n alert('Meowww...');\n }\n });\n\n var kitty = new My.awesome.Cat;\n kitty.meow();\n
\nOverride prototype members of this class. Overridden methods can be invoked via\ncallOverridden
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n\n return this;\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n var instance = this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n\n return instance;\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
\nthis
\nFires when the server returns an exception
\nThe response from the AJAX request
\nThe operation that triggered request
\nThe options object passed to Ext.util.Observable.addListener.
\n\n\n\n