Share via


Ewa.WorkbookEventArgs.getWorkbook()

Applies to: apps for SharePoint | SharePoint Server 2010

In this article
Return Value
Remarks
Example
Applies To

Gets the workbook object that is applicable to the event.

var value = Ewa.WorkbookEventArgs.getWorkbook();

Return Value

Workbook

Remarks

The Ewa.WorkbookEventArgs.getWorkbook method returns the workbook that is associated with the specified event.

Example

The following code example shows how to subscribe an event handler to the gridSynchronized event. The code then uses the Ewa.WorkbookEventArgs.getWorkbook method to get information about the selected range in the associated workbook.

var ewa = null;

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

// 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()
{
    ewa = Ewa.EwaControl.getInstances().getItem(0);

    // Add event handler for gridSynchronized event.
    ewa.add_gridSynchronized(gridSync);
}

// Handle gridSynchronized event.
function gridSync(workbookEventArgs)
{
    alert(workbookEventArgs. getWorkbook().getActiveSelection().getAddressA1());
}

Applies To

Ewa.WorkbookEventArgs Object

See Also

Reference

Ewa.WorkbookEventArgs Methods

Concepts

Ewa Namespace