次の方法で共有


Ewa.EwaControl.remove_activeSelectionChanged(function)

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

指定したイベント ハンドラー **[activeSelectionChanged]**イベントの購読を取り消します。

Ewa.EwaControl.remove_activeSelectionChanged(function);

パラメーター

function

イベント ハンドラーはイベントの購読を解除します。

戻り値

なし。

次の例では、 **[activeSelectionChanged]**イベントから指定したイベント ハンドラーを購読する方法を示します。コードの例を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.");
    }
    // ...
}

// Handle the applicationReady event.
function ewaApplicationReady()
{
    // Get a reference to the Excel Services Web Part.
    ewa = Ewa.EwaControl.getInstances().getItem(0);
    // Add an event handler for the 
    // active selection changed event.
    ewa.add_activeSelectionChanged(selectionChanged);

    // ...
}

function myFunction ()
{
    // Remove event handler from activeSelectionChanged.
    ewa.remove_activeSelectionChanged(selectionChanged);

    // ...
}

</script>

関連項目

参照先

Ewa.EwaControl.add_activeSelectionChanged(function)

Ewa.EwaControl オブジェクト