Share via


Ewa.EwaControl.getInstances()

**適用対象:**apps for SharePoint | Excel Services | SharePoint Server 2013

この記事の内容
戻り値
注釈

対象

**EwaControlCollectionオブジェクトが使用できるEwaControl**インスタンスを取得します。

var value = Ewa.EwaControl.getInstances();

戻り値

[Type]: Ewa.ControlCollection

注釈

**[EwaControl.getInstances]**は、ページのEwaControlCollectionを返すEwaControlクラスの静的な方法です。

次の例は、 Excel Web Access Web パーツ ページ上のコレクションへの参照を取得するEwaControl.getInstances静的メソッドを使用する方法を示しています。 と関数を使用してEwa.EwaControlCollection.getItem(index)メソッドを取得Excel Web Access Web パーツ ページ上の別の参照。コードの例では、 Excel Web Access Web パーツでSharePoint Server 2013で作業していることを前提としています。

<script type="text/javascript">

// Initialize variables.
var EWA1 = null;
var EWA2 = null;

// Add event handler for onload event.
if (window.attachEvent) 
{ 
    window.attachEvent("onload", ewaOnPageLoad);    
} 
else 
{ 
    window.addEventListener("DOMContentLoaded", ewaOnPageLoad, false); 
}

// Set page event handlers for onload, proceed to the ewaOnPageLoad function defined below once the page has loaded if (window.attachEvent){
    window.attachEvent("onload", ewaOnPageLoad);
}

// Add an event handler for the applicationReady event.
function ewaOnPageLoad()
{
    Ewa.EwaControl.add_applicationReady(onApplicationReady);
}

// Attach to the individual Excel Web Access (EWA) web parts.
function onApplicationReady()
{
    EWA1 = Ewa.EwaControl.getInstances().getItem(0);
    EWA2 = Ewa.EwaControl.getInstances().getItem(1);

    // ...
} 
</script>

対象

Ewa.EwaControl オブジェクト

関連項目

概念

Ewa.EwaControl 方法

Ewa 名前空間