Ext.data.JsonP.Ext_form_action_Load({"mixins":[],"code_type":"ext_define","inheritable":false,"component":false,"meta":{},"mixedInto":[],"uses":[],"aliases":{"formaction":["load"]},"parentMixins":[],"superclasses":["Ext.Base","Ext.form.action.Action"],"members":{"event":[],"property":[{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"$className","id":"property-S-className"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"configMap","id":"property-configMap"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"property","name":"failureType","id":"property-failureType"},{"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.form.action.Action","tagname":"property","name":"response","id":"property-response"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"property","name":"result","id":"property-result"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"property","name":"self","id":"property-self"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"property","name":"type","id":"property-type"}],"css_var":[],"method":[{"meta":{},"owner":"Ext.form.action.Action","tagname":"method","name":"constructor","id":"method-constructor"},{"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":{"private":true},"owner":"Ext.Base","tagname":"method","name":"configClass","id":"method-configClass"},{"meta":{"private":true},"owner":"Ext.form.action.Action","tagname":"method","name":"createCallback","id":"method-createCallback"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"destroy","id":"method-destroy"},{"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":{"private":true},"owner":"Ext.form.action.Action","tagname":"method","name":"getMethod","id":"method-getMethod"},{"meta":{"private":true},"owner":"Ext.form.action.Action","tagname":"method","name":"getParams","id":"method-getParams"},{"meta":{"private":true},"owner":"Ext.form.action.Action","tagname":"method","name":"getUrl","id":"method-getUrl"},{"meta":{"private":true},"owner":"Ext.form.action.Load","tagname":"method","name":"handleResponse","id":"method-handleResponse"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"hasConfig","id":"method-hasConfig"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"initConfig","id":"method-initConfig"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"onConfigUpdate","id":"method-onConfigUpdate"},{"meta":{"private":true},"owner":"Ext.form.action.Action","tagname":"method","name":"onFailure","id":"method-onFailure"},{"meta":{"private":true},"owner":"Ext.form.action.Load","tagname":"method","name":"onSuccess","id":"method-onSuccess"},{"meta":{"private":true},"owner":"Ext.form.action.Action","tagname":"method","name":"processResponse","id":"method-processResponse"},{"meta":{"private":true},"owner":"Ext.form.action.Load","tagname":"method","name":"run","id":"method-run"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"setConfig","id":"method-setConfig"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"statics","id":"method-statics"}],"css_mixin":[],"cfg":[{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"failure","id":"cfg-failure"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"form","id":"cfg-form"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"headers","id":"cfg-headers"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"method","id":"cfg-method"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"params","id":"cfg-params"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"reset","id":"cfg-reset"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"scope","id":"cfg-scope"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"submitEmptyText","id":"cfg-submitEmptyText"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"success","id":"cfg-success"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"timeout","id":"cfg-timeout"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"url","id":"cfg-url"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"waitMsg","id":"cfg-waitMsg"},{"meta":{},"owner":"Ext.form.action.Action","tagname":"cfg","name":"waitTitle","id":"cfg-waitTitle"}]},"tagname":"class","extends":"Ext.form.action.Action","html":"
Alternate names
Ext.form.Action.LoadHierarchy
Ext.BaseExt.form.action.ActionExt.form.action.LoadRequires
Subclasses
Files
A class which handles loading of data from a server into the Fields of an Ext.form.Basic.
\n\nInstances of this class are only created by a Form when loading.
\n\nA response packet must contain:
\n\nsuccess
property : Booleandata
property : ObjectThe data
property contains the values of Fields to load. The individual value object for each Field is passed to\nthe Field's setValue method.
By default, response packets are assumed to be JSON, so for the following form load call:
\n\nvar myFormPanel = new Ext.form.Panel({\n title: 'Client and routing info',\n renderTo: Ext.getBody(),\n defaults: {\n xtype: 'textfield'\n },\n items: [{\n fieldLabel: 'Client',\n name: 'clientName'\n }, {\n fieldLabel: 'Port of loading',\n name: 'portOfLoading'\n }, {\n fieldLabel: 'Port of discharge',\n name: 'portOfDischarge'\n }]\n});\nmyFormPanel.getForm().load({\n url: '/getRoutingInfo.php',\n params: {\n consignmentRef: myConsignmentRef\n },\n failure: function(form, action) {\n Ext.Msg.alert(\"Load failed\", action.result.errorMessage);\n }\n});\n
\n\na success response packet may look like this:
\n\n{\n success: true,\n data: {\n clientName: \"Fred. Olsen Lines\",\n portOfLoading: \"FXT\",\n portOfDischarge: \"OSL\"\n }\n}\n
\n\nwhile a failure response packet may look like this:
\n\n{\n success: false,\n errorMessage: \"Consignment reference not found\"\n}\n
\n\nOther data may be placed into the response for processing the Form's callback or event handler\nmethods. The object decoded from this JSON is available in the result property.
\nThe function to call when a failure packet was received, or when an error ocurred in the Ajax communication.
\nThe form that requested the action
\nThe Action class. If an Ajax error ocurred, the failure type will\nbe in failureType. The result property of this object may be examined to perform custom\npostprocessing.
\nThe BasicForm instance that is invoking this Action. Required.
\nExtra headers to be sent in the AJAX request for submit and load actions.\nSee Ext.data.proxy.Ajax.headers.
\nThe HTTP method to use to access the requested URL.\nDefaults to the BasicForm's method, or 'POST' if not specified.
\nExtra parameter values to pass. These are added to the Form's Ext.form.Basic.baseParams and passed to the\nspecified URL along with the Form's input fields.
\n\nParameters are encoded as standard HTTP parameters using Ext.Object.toQueryString.
\nWhen set to true, causes the Form to be reset on Action success. If specified,\nthis happens before the success callback is called and before the Form's\nactioncomplete event fires.
\nIf set to true, the emptyText value will be sent with the form when it is submitted.
\nDefaults to: true
The function to call when a valid success return packet is received.
\nThe form that requested the action
\nThe Action class. The result property of this object may\nbe examined to perform custom postprocessing.
\nThe number of seconds to wait for a server response before failing with the failureType as\nCONNECT_FAILURE. If not specified, defaults to the configured\ntimeout of the form.
\nThe message to be displayed by a call to Ext.window.MessageBox.wait during the time the action is being\nprocessed.
\nThe message to be displayed by a call to Ext.window.MessageBox.wait during the time the action is being\nprocessed.
\nThe title to be displayed by a call to Ext.window.MessageBox.wait during the time the action is being\nprocessed.
\nThe title to be displayed by a call to Ext.window.MessageBox.wait during the time the action is being\nprocessed.
\nThe type of failure detected will be one of these:\nCLIENT_INVALID, SERVER_INVALID, CONNECT_FAILURE, or LOAD_FAILURE.
\n\nUsage:
\n\nvar fp = new Ext.form.Panel({\n...\nbuttons: [{\n text: 'Save',\n formBind: true,\n handler: function(){\n if(fp.getForm().isValid()){\n fp.getForm().submit({\n url: 'form-submit.php',\n waitMsg: 'Submitting your data...',\n success: function(form, action){\n // server responded with success = true\n var result = action.result;\n },\n failure: function(form, action){\n if (action.failureType === Ext.form.action.Action.CONNECT_FAILURE) {\n Ext.Msg.alert('Error',\n 'Status:'+action.response.status+': '+\n action.response.statusText);\n }\n if (action.failureType === Ext.form.action.Action.SERVER_INVALID){\n // server responded with success = false\n Ext.Msg.alert('Invalid', action.result.errormsg);\n }\n }\n });\n }\n }\n},{\n text: 'Reset',\n handler: function(){\n fp.getForm().reset();\n }\n}]\n
\nThe raw XMLHttpRequest object used to perform the action.
\nThe raw XMLHttpRequest object used to perform the action.
\nThe decoded response object containing a boolean success
property and other, action-specific properties.
The decoded response object containing a boolean success
property and other, action-specific properties.
Get the reference to the current class from which this object was instantiated. Unlike statics,\nthis.self
is scope-dependent and it's meant to be used for dynamic inheritance. See statics\nfor a detailed comparison
Ext.define('My.Cat', {\n statics: {\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n alert(this.self.speciesName); // dependent on 'this'\n },\n\n clone: function() {\n return new this.self();\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat'\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\n
\nCall the original method that was previously overridden with override
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\n This method has been deprecated
\nas of 4.1. Use callParent instead.
\n\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callOverridden(arguments)
Returns the result of calling the overridden method
\nCall the \"parent\" method of the current method. That is the method previously\noverridden by derivation or by an override (see Ext.define).
\n\n Ext.define('My.Base', {\n constructor: function (x) {\n this.x = x;\n },\n\n statics: {\n method: function (x) {\n return x;\n }\n }\n });\n\n Ext.define('My.Derived', {\n extend: 'My.Base',\n\n constructor: function () {\n this.callParent([21]);\n }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x); // alerts 21\n
\n\nThis can be used with an override as follows:
\n\n Ext.define('My.DerivedOverride', {\n override: 'My.Derived',\n\n constructor: function (x) {\n this.callParent([x*2]); // calls original My.Derived constructor\n }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x); // now alerts 42\n
\n\nThis also works with static methods.
\n\n Ext.define('My.Derived2', {\n extend: 'My.Base',\n\n statics: {\n method: function (x) {\n return this.callParent([x*2]); // calls My.Base.method\n }\n }\n });\n\n alert(My.Base.method(10); // alerts 10\n alert(My.Derived2.method(10); // alerts 20\n
\n\nLastly, it also works with overridden static methods.
\n\n Ext.define('My.Derived2Override', {\n override: 'My.Derived2',\n\n statics: {\n method: function (x) {\n return this.callParent([x*2]); // calls My.Derived2.method\n }\n }\n });\n\n alert(My.Derived2.method(10); // now alerts 40\n
\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callParent(arguments)
Returns the result of calling the parent method
\nGet the set of parameters specified in the BasicForm's baseParams and/or the params option.\nItems in params override items of the same name in baseParams.
\nthe full set of parameters
\nBuild the URL for the AJAX request. Used by the standard AJAX submit and load actions.
\nThe URL.
\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});\n\nvar awesome = new My.awesome.Class({\n name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\nthis
\nValidates that a response contains either responseText or responseXML and invokes\nhandleResponse to build the result object.
\nThe raw response 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\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
\nAdd methods / properties to the prototype of this class.
\n\nExt.define('My.awesome.Cat', {\n constructor: function() {\n ...\n }\n});\n\n My.awesome.Cat.addMembers({\n meow: function() {\n alert('Meowww...');\n }\n });\n\n var kitty = new My.awesome.Cat;\n kitty.meow();\n
\nAdd / override static properties of this class.
\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.addStatics({\n someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'\n method1: function() { ... }, // My.cool.Class.method1 = function() { ... };\n method2: function() { ... } // My.cool.Class.method2 = function() { ... };\n});\n
\nthis
\nBorrow another class' members to the prototype of this class.
\n\nExt.define('Bank', {\n money: '$$$',\n printMoney: function() {\n alert('$$$$$$$');\n }\n});\n\nExt.define('Thief', {\n ...\n});\n\nThief.borrow(Bank, ['money', 'printMoney']);\n\nvar steve = new Thief();\n\nalert(steve.money); // alerts '$$$'\nsteve.printMoney(); // alerts '$$$$$$$'\n
\nThe class to borrow members from
\nThe names of the members to borrow
\nthis
\nCreate 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
\nAdds members to class.
\nThis method has been deprecated since 4.1
\nUse addMembers instead.
\n\nOverride members of this class. Overridden methods can be invoked via\ncallParent.
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n this.callParent(arguments);\n\n alert(\"Meeeeoooowwww\");\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\n\nAs of 4.1, direct use of this method is deprecated. Use Ext.define\ninstead:
\n\nExt.define('My.CatOverride', {\n override: 'My.Cat',\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n this.callParent(arguments);\n\n alert(\"Meeeeoooowwww\");\n }\n});\n
\n\nThe above accomplishes the same result but can be managed by the Ext.Loader\nwhich can properly order the override and its target class and the build process\ncan determine whether the override is needed based on the required state of the\ntarget class (My.Cat).
\nThis method has been deprecated since 4.1.0
\nUse Ext.define instead
\n\nThe properties to add to this class. This should be\nspecified as an object literal containing one or more properties.
\nthis class
\n