SP へリストのオブジェクト (sp.js)
SharePoint Web サイト上のリストを表します。
**適用対象:**apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013
この記事の内容
メンバー
注釈
他のリソースのエンドポイント
var object = new SP.List()
メンバー
Listオブジェクトでは、次のメンバーがあります。
Constructor
Listオブジェクトでは、次のコンスがあります。
コンストラクター |
説明 |
---|---|
Initializes a new instance of the SP.List object. |
メソッド
Listオブジェクトでは、次の方法があります。
メソッド |
説明 |
---|---|
Creates a new list item in the list. |
|
Deletes the list. |
|
Returns the collection of changes from the change log that have occurred within the list, based on the specified query. |
|
Returns the list item with the specified list item identifier. |
|
Returns a collection of items from the list based on the specified query. |
|
Returns a collection of lookup fields that use this list as a data source and that have FieldLookup.IsRelationship set to true. |
|
このメンバーは内部使用のために予約済みです。ユーザーのコードから直接使用されるものではありません。 |
|
Returns the list view with the specified view identifier. |
|
Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item. |
|
Updates the database with changes that are made to the list. |
プロパティ
Listオブジェクトでは、次のプロパティがあります。
プロパティ |
説明 |
---|---|
Gets a value that specifies whether the list supports content types. |
|
Gets the list definition type on which the list is based. |
|
Gets the base type for the list. |
|
Gets a value that specifies the override of the web application's BrowserFileHandling property at the list level. |
|
Gets the content types that are associated with the list. |
|
Gets or sets a value that specifies whether content types are enabled for the list. |
|
Gets a value that specifies when the list was created. |
|
Gets the data source associated with the list, or null if the list is not a virtual list. |
|
Gets or sets a value that specifies the default workflow identifier for content approval on the list. |
|
Gets or sets a value that specifies the location of the default display form for the list. |
|
Gets or sets a value that specifies the URL of the edit form to use for list items in the list. |
|
Gets or sets a value that specifies the location of the default new form for the list. |
|
Gets the URL of the default view for the list. |
|
Gets or sets a value that specifies the description of the list. |
|
Gets or sets a value that specifies the reading order of the list. |
|
Gets or sets a value that specifies the server-relative URL of the document template for the list. |
|
Gets or sets a value that specifies the minimum permission required to view minor versions and drafts within the list. |
|
Gets a value that specifies the effective permissions on the list that are assigned to the current user. |
|
Gets or sets a value that specifies whether list item attachments are enabled for the list. |
|
Gets or sets a value that specifies whether new list folders can be added to the list. |
|
Gets or sets a value that specifies whether minor versions are enabled for the list. |
|
Gets or sets a value that specifies whether content approval is enabled for the list. |
|
Gets or sets a value that specifies whether historical versions of list items and documents can be created in the list. |
|
Gets a value that specifies the collection of all fields in the list. |
|
Gets or sets a value that indicates whether forced checkout is enabled for the document library. |
|
Gets a value that specifies the collection of all list forms in the list. |
|
Gets a value that specifies whether the list is an external list. |
|
Gets or sets a Boolean value that specifies whether the list is hidden. |
|
Gets the GUID that identifies the list in the database. |
|
Gets a value that specifies the URI for the icon of the list. |
|
Gets or sets a value that specifies a flag that a client application can use to determine whether to display the list. |
|
Gets a value that specifies whether the list is a gallery. |
|
Gets a value that indicates whether the list is designated as a default asset location for images or other files which the users upload to their wiki pages. |
|
Gets a value that specifies the number of list items in the list. |
|
Gets a value that specifies the last time a list item was deleted from the list. |
|
Gets a value that specifies the last time a list item, field, or property of the list was modified. |
|
Gets or sets a value that indicates whether the list in a Meeting Workspace site contains data for multiple meeting instances within the site. |
|
Gets or sets a value that specifies that the crawler must not crawl the list. |
|
Gets or sets a value that specifies whether the list appears on the Quick Launch of the site. |
|
Gets a value that specifies the site that contains the list. |
|
Gets a value that specifies the server-relative URL of the site that contains the list. |
|
Gets the root folder that contains the files in the list and any related files. |
|
Gets a value that specifies the list schema of the list. |
|
Gets a value that indicates whether folders can be created within the list. |
|
Gets a value that specifies the feature identifier of the feature that contains the list schema for the list. |
|
Gets or sets the displayed title for the list. |
|
Gets a value that specifies the collection of all user custom actions for the list. |
|
Gets or sets a value that specifies the data validation criteria for a list item. |
|
Gets or sets a value that specifies the error message returned when data validation fails for a list item. |
|
Gets a value that specifies the collection of all public views on the list and personal views of the current user on the list. |
|
Gets a value that specifies the collection of all workflow associations for the list. |
注釈
既定のスカラー プロパティの種類を設定するのには、BrowserFileHandling、データ ソース、EffectiveBasePermissions、HasUniqueRoleAssignments、IsAttachmentLibrary、OnQuickLaunch、SchemaXml、検証式、ValidationMessage プロパティは含まれていません。
例
次の例では、現在の web サイトに新しいディスカッション掲示板リストを作成するアプリケーション ページの [入力] ボタンを作成します。
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<script type="text/ecmascript" language="ecmascript">
var list;
function runCode() {
var clientContext = new SP.ClientContext.get_current();
if (clientContext != undefined && clientContext != null) {
var web = clientContext.get_web();
// Specify the properties of the new list.
var listCreationInfo = new SP.ListCreationInformation();
listCreationInfo.set_title('New Discussion Board');
listCreationInfo.set_templateType(SP.ListTemplateType.discussionBoard);
this.list = web.get_lists().add(listCreationInfo);
clientContext.load(list);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
}
function onQuerySucceeded() {
var result = ' Added Discussion Board: ' + this.list.get_title();
alert(result);
}
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)
HTTP 要求
このリソースには、次の HTTP コマンドがサポートしています。
書式を削除します。
DELETE http://<sitecollection>/<site>/_api/web/lists(listid)
書式を結合します。
MERGE http://<sitecollection>/<site>/_api/web/lists(listid)
投稿の書式
POST http://<sitecollection>/<site>/_api/web/lists(listid)
書式を配置します。
PUT http://<sitecollection>/<site>/_api/web/lists(listid)