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オブジェクトでは、次の方法があります。
メソッド |
説明 |
---|---|
Deletes the list view. |
|
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. |
|
Gets or sets a value that specifies whether totals are shown in the list view. |
|
Gets a value that specifies the base view identifier of the list view. |
|
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. |
|
Gets or sets a value that specifies whether the list view is the default list view. |
|
Gets or sets a value that specifies whether the list view is the default list view for the content type specified by contentTypeId. |
|
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. |
|
Gets a value that specifies the XML document that represents the list view. |
|
Gets a value that specifies the view identifier of the list view. |
|
Gets a value that specifies the URI (Uniform Resource Identifier) of the image for the list view. |
|
Gets or sets a value that specifies whether the current folder is displayed in the list view. |
|
Gets or sets the name of the JavaScript file used for the view. |
|
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. |
|
Gets or sets a value that specifies whether the list view is the default mobile list view. |
|
Gets or sets a value that specifies whether the list view is a mobile list view. |
|
Gets a value that specifies the content approval type for the list view. |
|
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. |
|
Gets a value that specifies whether the list view is a personal view. |
|
Gets a value that specifies whether the list view is read-only. |
|
Gets a value that specifies whether the list view requires client integration rights. |
|
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. |
|
Gets a value that specifies the server-relative URL of the list view page. |
|
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. |
|
Gets a value that specifies the name of the template for the toolbar that is used in the list view. |
|
Gets or sets a value that specifies the view data for the list view. |
|
Gets a value that specifies the collection of fields in the list view. |
|
Gets or sets a value that specifies the joins that are used in the list view. |
|
Gets or sets a value that specifies the projected fields that will be used by the list view. |
|
Gets or sets a value that specifies the query that is used by the list view. |
|
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)