SP へオブジェクトの表示 (sp.js)

ユーザーに対する変更です。

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

var object = new SP.View()

メンバー

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

Constructor

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

コンストラクター

説明

ビュー

Initializes a new instance of the SP へオブジェクトの表示 (sp.js).

メソッド

Viewオブジェクトでは、次の方法があります。

メソッド

説明

deleteObject

Deletes the list view.

initPropertiesFromJson

renderAsHtml

Returns the list view as HTML.

更新プログラム

Commits changed properties of the list view.

プロパティ

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

プロパティ

説明

集計

Gets or sets a value that specifies fields and functions that define totals shown in a list view.

aggregationsStatus

Gets or sets a value that specifies whether totals are shown in the list view.

baseViewId

Gets a value that specifies the base view identifier of the list view.

contentTypeId

Gets or sets the identifier of the content type with which the view is associated so that the view is available only on folders of this content type.

defaultView

Gets or sets a value that specifies whether the list view is the default list view.

defaultViewForContentType

Gets or sets a value that specifies whether the list view is the default list view for the content type specified by contentTypeId.

editorModified

Gets or sets a value that specifies whether the list view was modified in an editor.

書式

Gets or sets a value that specifies the column and row formatting for the list view.

非表示

Gets or sets a value that specifies whether the list view is hidden.

htmlSchemaXml

Gets a value that specifies the XML document that represents the list view.

id

Gets a value that specifies the view identifier of the list view.

imageUrl

Gets a value that specifies the URI (Uniform Resource Identifier) of the image for the list view.

includeRootFolder

Gets or sets a value that specifies whether the current folder is displayed in the list view.

jsLink

Gets or sets the name of the JavaScript file used for the view.

listViewXml

Gets or sets a string that represents the view XML.

> [!NOTE] >

JSLink プロパティは、アンケートの一覧またはイベントの一覧ではサポートされていません。SharePoint の予定表はイベントの一覧です。

方法

Gets or sets a value that specifies the view method for the list view.

mobileDefaultView

Gets or sets a value that specifies whether the list view is the default mobile list view.

mobileView

Gets or sets a value that specifies whether the list view is a mobile list view.

moderationType

Gets a value that specifies the content approval type for the list view.

orderedView

Gets a value that specifies whether list items can be reordered in the list view.

ページ

Gets or sets a value that specifies whether the list view is a paged view.

personalView

Gets a value that specifies whether the list view is a personal view.

readOnlyView

Gets a value that specifies whether the list view is read-only.

requiresClientIntegration

Gets a value that specifies whether the list view requires client integration rights.

rowLimit

Gets or sets a value that specifies the maximum number of list items to display in a visual page of the list view.

範囲

Gets or sets a value that specifies the scope for the list view.

serverRelativeUrl

Gets a value that specifies the server-relative URL of the list view page.

styleId

Gets a value that specifies the identifier of the view style for the list view.

スレッド形式

Gets a value that specifies whether the list view is a threaded view.

タイトル

Gets or sets a value that specifies the display name of the list view.

ツールバー

Gets or sets a value that specifies the toolbar for the list view.

toolbarTemplateName

Gets a value that specifies the name of the template for the toolbar that is used in the list view.

viewData

Gets or sets a value that specifies the view data for the list view.

viewFields

Gets a value that specifies the collection of fields in the list view.

viewJoins

Gets or sets a value that specifies the joins that are used in the list view.

viewProjectedFields

Gets or sets a value that specifies the projected fields that will be used by the list view.

viewQuery

Gets or sets a value that specifies the query that is used by the list view.

viewType

Gets a value that specifies the type of the list view.

次の例では、アルファベットの降順で現在のサイトのタスク リストにアイテムの順序をアプリケーション] ページで、[入力] ボタンを作成します。

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

    function runCode() {

        var clientContext = new SP.ClientContext.get_current();

        if (clientContext != undefined && clientContext != null) {
            var web = clientContext.get_web();

            var listCollection = web.get_lists();
            var list = listCollection.getByTitle("Tasks");
            var viewCollection = list.get_views();
            var view = viewCollection.getByTitle("All Tasks");

            var query = '<OrderBy><FieldRef Name=\'Title\' Ascending=\'False\' /></OrderBy>';

            view.set_viewQuery(query);
            view.update();

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

    function onQuerySucceeded() {
        alert('Tasks list ordered in descending alphabetic order.');
    }

    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/lists(listid)/Views(viewid)

HTTP 要求

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

書式を削除します。

DELETE http://<sitecollection>/<site>/_api/web/lists(listid)/Views(viewid)

書式を結合します。

MERGE http://<sitecollection>/<site>/_api/web/lists(listid)/Views(viewid)

投稿の書式

POST http://<sitecollection>/<site>/_api/web/lists(listid)/Views(viewid)

書式を配置します。

PUT http://<sitecollection>/<site>/_api/web/lists(listid)/Views(viewid)