X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..HEAD:/docs/output/Ext.form.action.DirectSubmit.js?ds=sidebyside diff --git a/docs/output/Ext.form.action.DirectSubmit.js b/docs/output/Ext.form.action.DirectSubmit.js index 0f1c0e76..cb439bd4 100644 --- a/docs/output/Ext.form.action.DirectSubmit.js +++ b/docs/output/Ext.form.action.DirectSubmit.js @@ -1,502 +1 @@ -Ext.data.JsonP.Ext_form_action_DirectSubmit({ - "tagname": "class", - "name": "Ext.form.action.DirectSubmit", - "doc": "
Provides Ext.direct support for submitting form data.
\n\n\nThis example illustrates usage of Ext.direct.Direct to submit a form through Ext.Direct.
\n\n\nvar myFormPanel = new Ext.form.Panel({\n // configs for FormPanel\n title: 'Basic Information',\n renderTo: document.body,\n width: 300, height: 160,\n padding: 10,\n buttons:[{\n text: 'Submit',\n handler: function(){\n myFormPanel.getForm().submit({\n params: {\n foo: 'bar',\n uid: 34\n }\n });\n }\n }],\n\n // configs apply to child items\n defaults: {anchor: '100%'},\n defaultType: 'textfield',\n items: [{\n fieldLabel: 'Name',\n name: 'name'\n },{\n fieldLabel: 'Email',\n name: 'email'\n },{\n fieldLabel: 'Company',\n name: 'company'\n }],\n\n // configs for BasicForm\n api: {\n // The server-side method to call for load() requests\n load: Profile.getBasicInfo,\n // The server-side must mark the submit handler as a 'formHandler'\n submit: Profile.updateBasicInfo\n },\n // specify the order for the passed params\n paramOrder: ['uid', 'foo']\n});\n
\n\n\nThe data packet sent to the server will resemble something like:
\n\n{\n \"action\":\"Profile\",\"method\":\"updateBasicInfo\",\"type\":\"rpc\",\"tid\":\"6\",\n \"result\":{\n \"success\":true,\n \"id\":{\n \"extAction\":\"Profile\",\"extMethod\":\"updateBasicInfo\",\n \"extType\":\"rpc\",\"extTID\":\"6\",\"extUpload\":\"false\",\n \"name\":\"Aaron Conran\",\"email\":\"aaron@sencha.com\",\"company\":\"Sencha Inc.\"\n }\n }\n}\n
\n\n\nThe form will process a data packet returned by the server that is similar\nto the following:
\n\n// sample success packet (batched requests)\n[\n {\n \"action\":\"Profile\",\"method\":\"updateBasicInfo\",\"type\":\"rpc\",\"tid\":3,\n \"result\":{\n \"success\":true\n }\n }\n]\n\n// sample failure packet (one request)\n{\n \"action\":\"Profile\",\"method\":\"updateBasicInfo\",\"type\":\"rpc\",\"tid\":\"6\",\n \"result\":{\n \"errors\":{\n \"email\":\"already taken\"\n },\n \"success\":false,\n \"foo\":\"bar\"\n }\n}\n
\n\n\nAlso see the discussion in Ext.form.action.DirectLoad.
\n", - "extends": "Ext.form.action.Submit", - "mixins": [ - - ], - "alternateClassNames": [ - "Ext.form.Action.DirectSubmit" - ], - "xtype": null, - "author": null, - "docauthor": null, - "singleton": false, - "private": false, - "cfg": [ - { - "tagname": "cfg", - "name": "clientValidation", - "member": "Ext.form.action.Submit", - "type": "boolean", - "doc": "Determines whether a Form's fields are validated\nin a final call to isValid prior to submission.\nPass false in the Form's submit options to prevent this. Defaults to true.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Submit.js", - "linenr": 64, - "html_filename": "Submit.html", - "href": "Submit.html#Ext-form-action-Submit-cfg-clientValidation", - "shortDoc": "Determines whether a Form's fields are validated\nin a final call to isValid prior to submission.\nPass false in the Fo..." - }, - { - "tagname": "cfg", - "name": "failure", - "member": "Ext.form.action.Action", - "type": "Function", - "doc": "The function to call when a failure packet was received, or when an\nerror ocurred in the Ajax communication.\nThe function is passed the following parameters:
The BasicForm instance that\nis invoking this Action. Required.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 20, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-form" - }, - { - "tagname": "cfg", - "name": "headers", - "member": "Ext.form.action.Action", - "type": "Object", - "doc": "Extra headers to be sent in the AJAX request for submit and load actions. See\nExt.data.Connection.headers.
\n\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 49, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-headers" - }, - { - "tagname": "cfg", - "name": "method", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "The HTTP method to use to access the requested URL. Defaults to the\nBasicForm's method, or 'POST' if not specified.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 37, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-method" - }, - { - "tagname": "cfg", - "name": "params", - "member": "Ext.form.action.Action", - "type": "Object/String", - "doc": "Extra parameter values to pass. These are added to the Form's\nExt.form.Basic.baseParams and passed to the specified URL along with the Form's\ninput fields.
\n\n\nParameters are encoded as standard HTTP parameters using Ext.Object.toQueryString.
\n\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 42, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-params", - "shortDoc": "Extra parameter values to pass. These are added to the Form's\nExt.form.Basic.baseParams and passed to the specified U..." - }, - { - "tagname": "cfg", - "name": "reset", - "member": "Ext.form.action.Action", - "type": "Boolean", - "doc": "When set to true, causes the Form to be\nreset on Action success. If specified, this happens\nbefore the success callback is called and before the Form's\nactioncomplete event fires.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 30, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-reset", - "shortDoc": "When set to true, causes the Form to be\nreset on Action success. If specified, this happens\nbefore the success callba..." - }, - { - "tagname": "cfg", - "name": "scope", - "member": "Ext.form.action.Action", - "type": "Object", - "doc": "The scope in which to call the configured success and failure\ncallback functions (the this reference for the callback functions).
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 81, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-scope", - "shortDoc": "The scope in which to call the configured success and failure\ncallback functions (the this reference for the callback..." - }, - { - "tagname": "cfg", - "name": "submitEmptyText", - "member": "Ext.form.action.Action", - "type": "Boolean", - "doc": "If set to true, the emptyText value will be sent with the form\nwhen it is submitted. Defaults to true.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 96, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-submitEmptyText" - }, - { - "tagname": "cfg", - "name": "success", - "member": "Ext.form.action.Action", - "type": "Function", - "doc": "The function to call when a valid success return packet is received.\nThe function is passed the following parameters:
The number of seconds to wait for a server response before\nfailing with the failureType as Ext.form.action.Action.CONNECT_FAILURE. If not specified,\ndefaults to the configured timeout of the\nform.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 54, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-timeout", - "shortDoc": "The number of seconds to wait for a server response before\nfailing with the failureType as Ext.form.action.Action.CON..." - }, - { - "tagname": "cfg", - "name": "url", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "The URL that the Action is to invoke. Will default to the url\nconfigured on the form.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 25, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-url" - }, - { - "tagname": "cfg", - "name": "waitMsg", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "The message to be displayed by a call to Ext.window.MessageBox.wait\nduring the time the action is being processed.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 86, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-waitMsg" - }, - { - "tagname": "cfg", - "name": "waitTitle", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "The title to be displayed by a call to Ext.window.MessageBox.wait\nduring the time the action is being processed.
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 91, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-cfg-waitTitle" - } - ], - "method": [ - { - "tagname": "method", - "name": "DirectSubmit", - "member": "Ext.form.action.Action", - "doc": "\n", - "params": [ - { - "type": "Object", - "name": "config", - "doc": "The configuration for this instance.
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 1, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-method-constructor", - "shortDoc": "\n" - }, - { - "tagname": "method", - "name": "callOverridden", - "member": "Ext.Base", - "doc": "Call the original method that was previously overridden with Ext.Base.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
\n",
- "params": [
- {
- "type": "Array/Arguments",
- "name": "args",
- "doc": "The arguments, either an array or the arguments
object
Returns the result after calling the overridden method
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Base.js", - "linenr": 279, - "html_filename": "Base3.html", - "href": "Base3.html#Ext-Base-method-callOverridden", - "shortDoc": "Call the original method that was previously overridden with Ext.Base.override\n\nExt.define('My.Cat', {\n constructo..." - }, - { - "tagname": "method", - "name": "getName", - "member": "Ext.Base", - "doc": "Get 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
\n",
- "params": [
-
- ],
- "return": {
- "type": "String",
- "doc": "className
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Base.js", - "linenr": 652, - "html_filename": "Base3.html", - "href": "Base3.html#Ext-Base-method-getName", - "shortDoc": "Get the current class' name in string format.\n\nExt.define('My.cool.Class', {\n constructor: function() {\n al..." - } - ], - "property": [ - { - "tagname": "property", - "name": "CLIENT_INVALID", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "Failure type returned when client side validation of the Form fails\nthus aborting a submit action. Client side validation is performed unless\nExt.form.action.Submit.clientValidation is explicitly set to false.
\n", - "private": false, - "static": true, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 271, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-property-CLIENT_INVALID", - "shortDoc": "Failure type returned when client side validation of the Form fails\nthus aborting a submit action. Client side valida..." - }, - { - "tagname": "property", - "name": "CONNECT_FAILURE", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "Failure type returned when a communication error happens when attempting\nto send a request to the remote server. The response may be examined to\nprovide further information.
\n", - "private": false, - "static": true, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 292, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-property-CONNECT_FAILURE", - "shortDoc": "Failure type returned when a communication error happens when attempting\nto send a request to the remote server. The ..." - }, - { - "tagname": "property", - "name": "LOAD_FAILURE", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "Failure type returned when the response's success\nproperty is set to false, or no field values are returned in the response's\ndata property.
\n", - "private": false, - "static": true, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 302, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-property-LOAD_FAILURE", - "shortDoc": "Failure type returned when the response's success\nproperty is set to false, or no field values are returned in the re..." - }, - { - "tagname": "property", - "name": "SERVER_INVALID", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "Failure type returned when server side processing fails and the result's\nsuccess property is set to false.
\n\n\nIn the case of a form submission, field-specific error messages may be returned in the\nresult's errors property.
\n\n", - "private": false, - "static": true, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 281, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-property-SERVER_INVALID", - "shortDoc": "Failure type returned when server side processing fails and the result's\nsuccess property is set to false.\n\n\nIn the c..." - }, - { - "tagname": "property", - "name": "addStatics", - "member": "Ext.Base", - "type": "Function", - "doc": "Add / 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
\n",
- "private": false,
- "static": true,
- "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Base.js",
- "linenr": 399,
- "html_filename": "Base3.html",
- "href": "Base3.html#Ext-Base-property-addStatics",
- "shortDoc": "Add / override static properties of this class.\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.addStatics(..."
- },
- {
- "tagname": "property",
- "name": "borrow",
- "member": "Ext.Base",
- "type": "Function",
- "doc": "Borrow 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
\n",
- "private": false,
- "static": true,
- "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Base.js",
- "linenr": 492,
- "html_filename": "Base3.html",
- "href": "Base3.html#Ext-Base-property-borrow",
- "shortDoc": "Borrow another class' members to the prototype of this class.\n\nExt.define('Bank', {\n money: '$$$',\n printMoney:..."
- },
- {
- "tagname": "property",
- "name": "create",
- "member": "Ext.Base",
- "type": "Function",
- "doc": "Create 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",
- "private": false,
- "static": true,
- "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Base.js",
- "linenr": 340,
- "html_filename": "Base3.html",
- "href": "Base3.html#Ext-Base-property-create",
- "shortDoc": "Create a new instance of this Class.\n\nExt.define('My.cool.Class', {\n ...\n});\n\nMy.cool.Class.create({\n someConfi..."
- },
- {
- "tagname": "property",
- "name": "createAlias",
- "member": "Ext.Base",
- "type": "Function",
- "doc": "Create 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
\n",
- "private": false,
- "static": true,
- "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Base.js",
- "linenr": 670,
- "html_filename": "Base3.html",
- "href": "Base3.html#Ext-Base-property-createAlias",
- "shortDoc": "Create aliases for existing prototype methods. Example:\n\nExt.define('My.cool.Class', {\n method1: function() { ... ..."
- },
- {
- "tagname": "property",
- "name": "failureType",
- "member": "Ext.form.action.Action",
- "type": "String",
- "doc": "The type of failure detected will be one of these: Ext.form.action.Action.CLIENT_INVALID,\nExt.form.action.Action.SERVER_INVALID, Ext.form.action.Action.CONNECT_FAILURE, or\nExt.form.action.Action.LOAD_FAILURE. Usage:
\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
\n\n",
- "private": false,
- "static": false,
- "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js",
- "linenr": 108,
- "html_filename": "Action2.html",
- "href": "Action2.html#Ext-form-action-Action-property-failureType",
- "shortDoc": "The type of failure detected will be one of these: Ext.form.action.Action.CLIENT_INVALID,\nExt.form.action.Action.SERV..."
- },
- {
- "tagname": "property",
- "name": "implement",
- "member": "Ext.Base",
- "type": "Function",
- "doc": "Add 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
\n",
- "private": false,
- "static": true,
- "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Base.js",
- "linenr": 428,
- "html_filename": "Base3.html",
- "href": "Base3.html#Ext-Base-property-implement",
- "shortDoc": "Add methods / properties to the prototype of this class.\n\nExt.define('My.awesome.Cat', {\n constructor: function() ..."
- },
- {
- "tagname": "property",
- "name": "override",
- "member": "Ext.Base",
- "type": "Function",
- "doc": "Override prototype members of this class. Overridden methods can be invoked via\nExt.Base.callOverridden
\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
\n",
- "private": false,
- "static": true,
- "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Base.js",
- "linenr": 536,
- "html_filename": "Base3.html",
- "href": "Base3.html#Ext-Base-property-override",
- "shortDoc": "Override prototype members of this class. Overridden methods can be invoked via\nExt.Base.callOverridden\n\nExt.define('..."
- },
- {
- "tagname": "property",
- "name": "response",
- "member": "Ext.form.action.Action",
- "type": "Object",
- "doc": "The raw XMLHttpRequest object used to perform the action.
\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 152, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-property-response" - }, - { - "tagname": "property", - "name": "result", - "member": "Ext.form.action.Action", - "type": "Object", - "doc": "The decoded response object containing a boolean success property and\nother, action-specific properties.
\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 158, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-property-result" - }, - { - "tagname": "property", - "name": "run", - "member": "Ext.form.action.Action", - "type": "Object", - "doc": "Invokes this action using the current configuration.
\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 179, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-property-run" - }, - { - "tagname": "property", - "name": "type", - "member": "Ext.form.action.Action", - "type": "String", - "doc": "The type of action this Action instance performs.\nCurrently only \"submit\" and \"load\" are supported.
\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/Action.js", - "linenr": 101, - "html_filename": "Action2.html", - "href": "Action2.html#Ext-form-action-Action-property-type" - } - ], - "event": [ - - ], - "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/form/action/DirectSubmit.js", - "linenr": 1, - "html_filename": "DirectSubmit.html", - "href": "DirectSubmit.html#Ext-form-action-DirectSubmit", - "cssVar": [ - - ], - "cssMixin": [ - - ], - "component": false, - "superclasses": [ - "Ext.Base", - "Ext.form.action.Action", - "Ext.form.action.Submit" - ], - "subclasses": [ - - ], - "mixedInto": [ - - ], - "allMixins": [ - - ] -}); \ No newline at end of file +Ext.data.JsonP.Ext_form_action_DirectSubmit({"tagname":"class","html":"Alternate names
Ext.form.Action.DirectSubmitHierarchy
Ext.BaseExt.form.action.ActionExt.form.action.SubmitExt.form.action.DirectSubmitRequires
Files
Provides Ext.direct support for submitting form data.
\n\n\nThis example illustrates usage of Ext.direct.Direct to submit a form through Ext.Direct.
\n\n\nvar myFormPanel = new Ext.form.Panel({\n // configs for FormPanel\n title: 'Basic Information',\n renderTo: document.body,\n width: 300, height: 160,\n padding: 10,\n buttons:[{\n text: 'Submit',\n handler: function(){\n myFormPanel.getForm().submit({\n params: {\n foo: 'bar',\n uid: 34\n }\n });\n }\n }],\n\n // configs apply to child items\n defaults: {anchor: '100%'},\n defaultType: 'textfield',\n items: [{\n fieldLabel: 'Name',\n name: 'name'\n },{\n fieldLabel: 'Email',\n name: 'email'\n },{\n fieldLabel: 'Company',\n name: 'company'\n }],\n\n // configs for BasicForm\n api: {\n // The server-side method to call for load() requests\n load: Profile.getBasicInfo,\n // The server-side must mark the submit handler as a 'formHandler'\n submit: Profile.updateBasicInfo\n },\n // specify the order for the passed params\n paramOrder: ['uid', 'foo']\n});\n
\n\n\nThe data packet sent to the server will resemble something like:
\n\n{\n \"action\":\"Profile\",\"method\":\"updateBasicInfo\",\"type\":\"rpc\",\"tid\":\"6\",\n \"result\":{\n \"success\":true,\n \"id\":{\n \"extAction\":\"Profile\",\"extMethod\":\"updateBasicInfo\",\n \"extType\":\"rpc\",\"extTID\":\"6\",\"extUpload\":\"false\",\n \"name\":\"Aaron Conran\",\"email\":\"aaron@sencha.com\",\"company\":\"Sencha Inc.\"\n }\n }\n}\n
\n\n\nThe form will process a data packet returned by the server that is similar\nto the following:
\n\n// sample success packet (batched requests)\n[\n {\n \"action\":\"Profile\",\"method\":\"updateBasicInfo\",\"type\":\"rpc\",\"tid\":3,\n \"result\":{\n \"success\":true\n }\n }\n]\n\n// sample failure packet (one request)\n{\n \"action\":\"Profile\",\"method\":\"updateBasicInfo\",\"type\":\"rpc\",\"tid\":\"6\",\n \"result\":{\n \"errors\":{\n \"email\":\"already taken\"\n },\n \"success\":false,\n \"foo\":\"bar\"\n }\n}\n
\n\n\nAlso see the discussion in Ext.form.action.DirectLoad.
\nDetermines whether a Form's fields are validated\nin a final call to isValid prior to submission.\nPass false in the Form's submit options to prevent this. Defaults to true.
\nThe function to call when a failure packet was received, or when an\nerror ocurred in the Ajax communication.\nThe function is passed the following parameters:
The BasicForm instance that\nis invoking this Action. Required.
\nExtra headers to be sent in the AJAX request for submit and load actions. See\nExt.data.proxy.Ajax.headers.
\n\nThe HTTP method to use to access the requested URL. Defaults to the\nBasicForm's method, or 'POST' if not specified.
\nExtra parameter values to pass. These are added to the Form's\nExt.form.Basic.baseParams and passed to the specified URL along with the Form's\ninput fields.
\n\n\nParameters are encoded as standard HTTP parameters using Ext.Object.toQueryString.
\n\nWhen set to true, causes the Form to be\nreset on Action success. If specified, this happens\nbefore the success callback is called and before the Form's\nactioncomplete event fires.
\nThe scope in which to call the configured success and failure\ncallback functions (the this reference for the callback functions).
\nIf set to true, the emptyText value will be sent with the form\nwhen it is submitted. Defaults to true.
\nDefaults to: true
The function to call when a valid success return packet is received.\nThe function is passed the following parameters:
The number of seconds to wait for a server response before\nfailing with the failureType as CONNECT_FAILURE. If not specified,\ndefaults to the configured timeout of the\nform.
\nThe message to be displayed by a call to Ext.window.MessageBox.wait\nduring the time the action is being processed.
\nThe message to be displayed by a call to Ext.window.MessageBox.wait\nduring the time the action is being processed.
\nThe title to be displayed by a call to Ext.window.MessageBox.wait\nduring the time the action is being processed.
\nThe title to be displayed by a call to Ext.window.MessageBox.wait\nduring the time the action is being processed.
\nThe type of failure detected will be one of these: CLIENT_INVALID,\nSERVER_INVALID, CONNECT_FAILURE, or\nLOAD_FAILURE. Usage:
\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 === CONNECT_FAILURE) {\n Ext.Msg.alert('Error',\n 'Status:'+action.response.status+': '+\n action.response.statusText);\n }\n if (action.failureType === 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
\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\nother, action-specific properties.
\nThe decoded response object containing a boolean success property and\nother, action-specific properties.
\nInvokes this action using the current configuration.
\nInvokes this action using the current configuration.
\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
\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
\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
\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
\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
\n