次の方法で共有


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オブジェクトでは、次の方法があります。

メソッド

説明

addItem

Creates a new list item in the list.

deleteObject

Deletes the list.

getChanges

Returns the collection of changes from the change log that have occurred within the list, based on the specified query.

getItemById

Returns the list item with the specified list item identifier.

getItems

Returns a collection of items from the list based on the specified query.

getListItemChangesSinceToken

getRelatedFields

Returns a collection of lookup fields that use this list as a data source and that have FieldLookup.IsRelationship set to true.

getRelatedFieldsExtendedData

このメンバーは内部使用のために予約済みです。ユーザーのコードから直接使用されるものではありません。

getUserEffectivePermissions

getView

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.

renderListData

renderListFormData

reserveListItemId

saveAsNewView

更新プログラム

Updates the database with changes that are made to the list.

プロパティ

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

プロパティ

説明

allowContentTypes

Gets a value that specifies whether the list supports content types.

baseTemplate

Gets the list definition type on which the list is based.

baseType

Gets the base type for the list.

browserFileHandling

Gets a value that specifies the override of the web application's BrowserFileHandling property at the list level.

contentTypes

Gets the content types that are associated with the list.

contentTypesEnabled

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.

dataSource

Gets the data source associated with the list, or null if the list is not a virtual list.

defaultContentApprovalWorkflowId

Gets or sets a value that specifies the default workflow identifier for content approval on the list.

defaultDisplayFormUrl

Gets or sets a value that specifies the location of the default display form for the list.

defaultEditFormUrl

Gets or sets a value that specifies the URL of the edit form to use for list items in the list.

defaultNewFormUrl

Gets or sets a value that specifies the location of the default new form for the list.

defaultView

defaultViewUrl

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.

documentTemplateUrl

Gets or sets a value that specifies the server-relative URL of the document template for the list.

draftVersionVisibility

Gets or sets a value that specifies the minimum permission required to view minor versions and drafts within the list.

effectiveBasePermissions

Gets a value that specifies the effective permissions on the list that are assigned to the current user.

effectiveBasePermissionsForUI

enableAttachments

Gets or sets a value that specifies whether list item attachments are enabled for the list.

enableFolderCreation

Gets or sets a value that specifies whether new list folders can be added to the list.

enableMinorVersions

Gets or sets a value that specifies whether minor versions are enabled for the list.

enableModeration

Gets or sets a value that specifies whether content approval is enabled for the list.

enableVersioning

Gets or sets a value that specifies whether historical versions of list items and documents can be created in the list.

entityTypeName

eventReceivers

フィールド

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

forceCheckout

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.

hasExternalDataSource

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.

id

Gets the GUID that identifies the list in the database.

imageUrl

Gets a value that specifies the URI for the icon of the list.

informationRightsManagementSettings

irmEnabled

irmExpire

irmReject

isApplicationList

Gets or sets a value that specifies a flag that a client application can use to determine whether to display the list.

isCatalog

Gets a value that specifies whether the list is a gallery.

isPrivate

isSiteAssetsLibrary

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.

itemCount

Gets a value that specifies the number of list items in the list.

lastItemDeletedDate

Gets a value that specifies the last time a list item was deleted from the list.

lastItemModifiedDate

Gets a value that specifies the last time a list item, field, or property of the list was modified.

listItemEntityTypeFullName

multipleDataList

Gets or sets a value that indicates whether the list in a Meeting Workspace site contains data for multiple meeting instances within the site.

noCrawl

Gets or sets a value that specifies that the crawler must not crawl the list.

onQuickLaunch

Gets or sets a value that specifies whether the list appears on the Quick Launch of the site.

parentWeb

Gets a value that specifies the site that contains the list.

parentWebUrl

Gets a value that specifies the server-relative URL of the site that contains the list.

rootFolder

Gets the root folder that contains the files in the list and any related files.

schemaXml

Gets a value that specifies the list schema of the list.

serverTemplateCanCreateFolders

Gets a value that indicates whether folders can be created within the list.

templateFeatureId

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.

userCustomActions

Gets a value that specifies the collection of all user custom actions for the list.

validationFormula

Gets or sets a value that specifies the data validation criteria for a list item.

validationMessage

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.

workflowAssociations

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)