プロパティ メソッド イベント コンフィグオプション ダイレクトリンク
Action
  Action.Submit
    Action.DirectSubmit

Ext.form.Action.DirectSubmitクラス

パッケージ:Ext.form
定義ファイル:Action.js
クラス:Ext.form.Action.DirectSubmit
継承元:Action.Submit

フォームデータを送信するためのExt.directのサポートを提供します。

この例は、Ext.Directを通ってフォームを送信するためのExt.Directの使用法を説明します。

var myFormPanel = new Ext.form.FormPanel({
    // FormPanel設定。 
    title: 'Basic Information',
    renderTo: document.body,
    width: 300, height: 160,
    padding: 10,
    buttons:[{
        text: 'Submit',
        handler: function(){
            myFormPanel.getForm().submit({
                params: {
                    foo: 'bar',
                    uid: 34
                }
            });
        }
    }],

    // 子アイテムに適用される設定。
    defaults: {anchor: '100%'},
    defaultType: 'textfield',
    items: [{
        fieldLabel: 'Name',
        name: 'name'
    },{
        fieldLabel: 'Email',
        name: 'email'
    },{
        fieldLabel: 'Company',
        name: 'company'
    }],

    // BasicForm設定
    api: {
        // load()リクエストのためのサーバサイドメソッドのコール。
        load: Profile.getBasicInfo,
        // サーバサイドは submitハンドラに'formHandler'というマークを付けなくてはなりません。
        submit: Profile.updateBasicInfo
    },
    // 渡されるparams順番を指定してください。
    paramOrder: ['uid', 'foo']
});
サーバーに送られたデータパケットは、何かに似ています:
{
    "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
    "result":{
        "success":true,
        "id":{
            "extAction":"Profile","extMethod":"updateBasicInfo",
            "extType":"rpc","extTID":"6","extUpload":"false",
            "name":"Aaron Conran","email":"aaron@extjs.com","company":"Ext JS, LLC"
        }
    }
}
フォームは、サーバによって返された次のことと類似しているデータパケットを処理するでしょう:
// successパケットの例 (バッチ処理のリクエスト)
[
    {
        "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":3,
        "result":{
            "success":true
        }
    }
]

// failureパケットの例(1回のリクエスト)
{
        "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
        "result":{
            "errors":{
                "email":"already taken"
            },
            "success":false,
            "foo":"bar"
        }
}
同じくExt.form.Action.DirectLoadで議論を見てください。

Provides Ext.direct support for submitting form data.

This example illustrates usage of Ext.Direct to submit a form through Ext.Direct.

var myFormPanel = new Ext.form.FormPanel({
    // configs for FormPanel
    title: 'Basic Information',
    renderTo: document.body,
    width: 300, height: 160,
    padding: 10,
    buttons:[{
        text: 'Submit',
        handler: function(){
            myFormPanel.getForm().submit({
                params: {
                    foo: 'bar',
                    uid: 34
                }
            });
        }
    }],

    // configs apply to child items
    defaults: {anchor: '100%'},
    defaultType: 'textfield',
    items: [{
        fieldLabel: 'Name',
        name: 'name'
    },{
        fieldLabel: 'Email',
        name: 'email'
    },{
        fieldLabel: 'Company',
        name: 'company'
    }],

    // configs for BasicForm
    api: {
        // The server-side method to call for load() requests
        load: Profile.getBasicInfo,
        // The server-side must mark the submit handler as a 'formHandler'
        submit: Profile.updateBasicInfo
    },
    // specify the order for the passed params
    paramOrder: ['uid', 'foo']
});
The data packet sent to the server will resemble something like:
{
    "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
    "result":{
        "success":true,
        "id":{
            "extAction":"Profile","extMethod":"updateBasicInfo",
            "extType":"rpc","extTID":"6","extUpload":"false",
            "name":"Aaron Conran","email":"aaron@extjs.com","company":"Ext JS, LLC"
        }
    }
}
The form will process a data packet returned by the server that is similar to the following:
// sample success packet (batched requests)
[
    {
        "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":3,
        "result":{
            "success":true
        }
    }
]

// sample failure packet (one request)
{
        "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
        "result":{
            "errors":{
                "email":"already taken"
            },
            "success":false,
            "foo":"bar"
        }
}
Also see the discussion in Ext.form.Action.DirectLoad.

コンフィグオプション

コンフィグオプション定義クラス
 scope : Object
コールバック関数がコールされるときのスコープを設定します(コールバック関数のためのthis参照)。
The scope in which to call the callback functions (The this reference for the callback functions).
Ext.form.Action
 url : String
アクションが呼び出すURLを設定します。
The URL that the Action is to invoke.
Ext.form.Action
 waitMsg : String
アクションを処理されている時間に、メッセージがExt.MessageBox.waitへのコールによって表示されます。
The message to be displayed by a call to Ext.MessageBox.wait during the time the action is being processed.
Ext.form.Action
 waitTitle : String
アクションを処理されている時間に、タイトルがExt.MessageBox.waitへのコールによって表示されます。
The title to be displayed by a call to Ext.MessageBox.wait during the time the action is being processed.
Ext.form.Action

プロパティ

プロパティ定義クラス
 response : Object
XMLHttpRequestオブジェクトはアクションの実行に使用されます。
The XMLHttpRequest object used to perform the action.
Ext.form.Action
 type : String
このアクションのインスタンスが実行するアクションのタイプ。現在、"submit"と"load"のみがサポートされています。
The type of action this Action instance performs. Currently only "submit" and "load" are supported.
Ext.form.Action

メソッド

このクラスで公開されているメソッドはありません。

イベント

このクラスで公開されているイベントはありません。