/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ Ext.data.JsonP.Ext_form_Action_DirectSubmit({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.form.Action.Submit","uses":[],"html":"
Hierarchy
Ext.form.ActionExt.form.Action.SubmitExt.form.Action.DirectSubmitFiles
Provides Ext.direct support for submitting form data.
\n\n\nThis example illustrates usage of Ext.Direct to submit a form through Ext.Direct.
\n\n\nvar myFormPanel = new Ext.form.FormPanel({\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@extjs.com\",\"company\":\"Ext JS, LLC\"\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. If not defined, pre-submission field validation\nis performed.
\nOptional. JSON is interpreted with\nno need for an errorReader.
\n\n\nA Reader which reads a single record from the returned data. The DataReader's\nsuccess property specifies how submission success is determined. The Record's\ndata provides the error messages to apply to any invalid form Fields.
\n\nThe function to call when a failure packet was recieved, or when an\nerror ocurred in the Ajax communication.\nThe function is passed the following parameters:
The HTTP method to use to access the requested URL. Defaults to the\nExt.form.BasicForm's method, or if that is not specified, the underlying DOM form's method.
\nExtra parameter values to pass. These are added to the Form's\nExt.form.BasicForm.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.urlEncode.
\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 callback functions (The this reference\nfor the callback functions).
\nThe scope in which to call the callback functions (The this reference\nfor the callback functions).
\nIf set to true, the emptyText value will be sent with the form\nwhen it is submitted. Defaults to true.
\nThe function to call when a valid success return packet is recieved.\nThe function is passed the following parameters:
The number of seconds to wait for a server response before\nfailing with the failureType as Action.CONNECT_FAILURE. If not specified,\ndefaults to the configured timeout of the\nform.
\nThe message to be displayed by a call to Ext.MessageBox.wait\nduring the time the action is being processed.
\nThe message to be displayed by a call to Ext.MessageBox.wait\nduring the time the action is being processed.
\nThe title to be displayed by a call to Ext.MessageBox.wait\nduring the time the action is being processed.
\nThe title to be displayed by a call to Ext.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 LOAD_FAILURE. Usage:
\n\nvar fp = new Ext.form.FormPanel({\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.CONNECT_FAILURE) {\n Ext.Msg.alert('Error',\n 'Status:'+action.response.status+': '+\n action.response.statusText);\n }\n if (action.failureType === Ext.form.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\nThe XMLHttpRequest object used to perform the action.
\nThe 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.
\nThe type of action this Action instance performs.\nCurrently only \"submit\" and \"load\" are supported.
\nDefaults to: 'directsubmit'
Overrides: Ext.form.Action.type
Direct actions have already been processed and therefore\nwe can directly set the result; Direct Actions do not have\na this.response property.
\n