次の方法で共有


Ewa.EwaControlCollection.getCount()

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

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

対象

ページ上のExcel Web Accessの数を表す Web パーツのインスタンスを取得します。

var value = Ewa.EwaControlCollection.getCount();

戻り値

Integer

注釈

**[EwaControlCollection.getCount]**メソッドは、ページ上の Web パーツのインスタンスをExcel Web Accessの数を返します。

次の例では、 Excel Web Access Web パーツのすべてのインスタンスの数をページに戻るには方法を示します。コードの例をExcel Web Access Web パーツでSharePoint Server 2013で作業していることを前提としています。

<script type="text/javascript">

var ewa = null;

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

// Add event handler for applicationReady event.
function ewaOnPageLoad()
{
    if (typeof (Ewa) != "undefined")
    {
        Ewa.EwaControl.add_applicationReady(ewaApplicationReady);
    }
    else
    {
        alert("Error - the EWA JS is not loaded.");
    }
}

function ewaApplicationReady()
{
    // Get count of all EWA instances.
    alert(Ewa.EwaControl.getInstances().getCount());
}

</script>

対象

Ewa.EwaControlCollection オブジェクト

関連項目

概念

Ewa.EwaControlCollection 方法

Ewa 名前空間