Ewa.EwaControlCollection.getCount()
Applies to: apps for SharePoint | SharePoint Server 2010
In this article
Return Value
Remarks
Example
Applies To
Gets the count of the Excel Web Access Web Part instances on the page.
var value = Ewa.EwaControlCollection.getCount();
Return Value
Integer
Remarks
The [EwaControlCollection.getCount] method returns the number of Excel Web Access Web Part instances on the page.
Example
The following code example shows how to return the count of all Excel Web Access Web Part instances on the page.
<script type="text/javascript">
var ewa = null;
// Add event handler for onload event.
if (window.attachEvent)
{
window.attachEvent("onload", ewaOmPageLoad);
}
else
{
window.addEventListener("DOMContentLoaded", ewaOmPageLoad, 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>
Applies To
Ewa.EwaControlCollection Object