SP へ機能のオブジェクト (sp.js)

特定のナビゲーション ノードへの URL を表し、ナビゲーション ノード コレクションにおけるそのナビゲーション ノードの並び順を操作するためのプロパティおよびメソッドへのアクセスを可能にします。

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

var object = new SP.Feature()

メンバー

Featureオブジェクトでは、次のメンバーがあります。

Constructor

Featureオブジェクトでは、次のコンスがあります。

コンストラクター

説明

機能

Initializes a new instance of the SP.Feature object.

プロパティ

Featureオブジェクトでは、次のプロパティがあります。

プロパティ

説明

definitionId

Gets a value that specifies the identifier for this feature.

次の例では、現在の Web サイトのアクティブな機能の識別子を表示するアプリケーション ページの [入力] ボタンを作成します。

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<script type="text/ecmascript" language="ecmascript">

    var featureCollection;
    var oneFeature;

    var site;
    function runCode() {
        var clientContext = new SP.ClientContext();
        site = clientContext.get_web();

        clientContext.load(site);

        featureCollection = site.get_features();
        clientContext.load(featureCollection);

        clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    }

    function onQuerySucceeded() {
        var listEnumerator = featureCollection.getEnumerator();
        var featureInfo = '';

        while (listEnumerator.moveNext()) {
            oneFeature = listEnumerator.get_current();
            featureInfo += 'Feature ID: ' + oneFeature.get_definitionId() + '\n';
        }
        alert(featureInfo);
    }

    function onQueryFailed(sender, args) {

        alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    }

</script>

    <input id="Button1" type="button" value="Run Code" onclick="runCode()" />

</asp:Content>

他のリソースのエンドポイント

エンドポイント URI 構造

http://<sitecollection>/<site>/_api/web/features(featureid)

HTTP 要求

このリソースには、次の HTTP コマンドがサポートしています。

投稿の書式

POST http://<sitecollection>/<site>/_api/web/features(featureid)