You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
32 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. This file is part of Ext JS 3.4
  3. Copyright (c) 2011-2013 Sencha Inc
  4. Contact: http://www.sencha.com/contact
  5. GNU General Public License Usage
  6. This file may be used under the terms of the GNU General Public License version 3.0 as
  7. published by the Free Software Foundation and appearing in the file LICENSE included in the
  8. packaging of this file.
  9. Please review the following information to ensure the GNU General Public License version 3.0
  10. requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  11. If you are unsure which license is appropriate for your use, please contact the sales department
  12. at http://www.sencha.com/contact.
  13. Build date: 2013-04-03 15:07:25
  14. */
  15. Ext.data.JsonP.Ext_form_Action_DirectSubmit({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.form.Action.Submit","uses":[],"html":"<div><pre class=\"hierarchy\"><h4>Hierarchy</h4><div class='subclass first-child'><a href='#!/api/Ext.form.Action' rel='Ext.form.Action' class='docClass'>Ext.form.Action</a><div class='subclass '><a href='#!/api/Ext.form.Action.Submit' rel='Ext.form.Action.Submit' class='docClass'>Ext.form.Action.Submit</a><div class='subclass '><strong>Ext.form.Action.DirectSubmit</strong></div></div></div><h4>Files</h4><div class='dependency'><a href='source/Action2.html#Ext-form-Action-DirectSubmit' target='_blank'>Action.js</a></div></pre><div class='doc-contents'><p>Provides Ext.direct support for submitting form data.</p>\n\n\n<p>This example illustrates usage of <a href=\"#!/api/Ext.Direct\" rel=\"Ext.Direct\" class=\"docClass\">Ext.Direct</a> to <b>submit</b> a form through <a href=\"#!/api/Ext.Direct\" rel=\"Ext.Direct\" class=\"docClass\">Ext.Direct</a>.</p>\n\n\n<pre><code>var myFormPanel = new <a href=\"#!/api/Ext.form.FormPanel\" rel=\"Ext.form.FormPanel\" class=\"docClass\">Ext.form.FormPanel</a>({\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</code></pre>\n\n\n<p>The data packet sent to the server will resemble something like:</p>\n\n<pre><code>{\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</code></pre>\n\n\n<p>The form will process a data packet returned by the server that is similar\nto the following:</p>\n\n<pre><code>// 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</code></pre>\n\n\n<p>Also see the discussion in <a href=\"#!/api/Ext.form.Action.DirectLoad\" rel=\"Ext.form.Action.DirectLoad\" class=\"docClass\">Ext.form.Action.DirectLoad</a>.</p>\n</div><div class='members'><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-cfg'>Config options</h3><div class='subsection'><div id='cfg-clientValidation' class='member first-child inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><a href='#!/api/Ext.form.Action.Submit' rel='Ext.form.Action.Submit' class='defined-in docCla