次の方法で共有


Sys.Application.init イベント

更新 : 2007 年 11 月

スクリプトが読み込まれた後、オブジェクトが作成される前に発生します。

Sys.Application.add_init(handler);
Sys.Application.remove_init(handler);

引数

  • handler
    init イベントからバインドまたはアンバインドするデリゲート関数。

解説

オブジェクトが作成される前に、デリゲート関数を init イベントにアタッチして、タスクを完了する必要があります。add_init アクセサはデリゲート関数を init イベントにバインドし、remove_init アクセサはアンバインドします。

使用例

次の例では、イベント ハンドラを init イベントに追加する方法を示します。イベント ハンドラは、2 つのカスタム コントロールをページに追加します。

// Attach a handler to the init event.
Sys.Application.add_init(applicationInitHandler);

function applicationInitHandler() {
    // Add two custom controls to the application.
    $create(Demo.HoverButton, {text: 'A HoverButton Control'}, 
        {click: start, hover: doSomethingOnHover, 
        unhover: doSomethingOnUnHover},
        null, $get('Button1'));
    $create(Demo.HighVis, null, null, null, $get('Button2'));
}

参照

参照

Sys.Application クラス

その他の技術情報

言語リファレンス