Export (0) Print
Expand All

Ewa.WorkbookEventArgs Object

Last modified: June 14, 2011

Applies to: apps for SharePoint | SharePoint Server 2010

Represents the workbook event arguments.

Ewa.WorkbookEventArgs

Ewa.WorkbookEventArgs enables you to get a reference to the workbook associated with the event.

The following code example shows how to subscribe an event handler to the gridSynchronized event. The code then uses the Ewa.WorkbookEventArgs object to get information about 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());
}

Show:
© 2014 Microsoft