PortalItemListModel QML Type

  • Esri.ArcGISRuntime
  • PortalItemListModel
  • Represents a list of portal items. More...

    Import Statement: import Esri.ArcGISRuntime
    Since: Esri.ArcGISRuntime 100.0




    Detailed Description

    A PortalItem is a unit of content in the Portal. This type is populated by starting an operation to retrieve content and then can be accessed after the operation is complete. For example, the list of items can be retrieved by querying the portal (such as with PortalQueryParametersForItems) or by fetching the featuredItems or by fetching the items belonging to a user.

    The model returns data for the following roles:

    urlurlThe URL for the resource represented by the item.
    itemIdstringThe ID of the item.
    accessEnums.PortalAccessThe level of access to the item.
    averageRatingrealThe average rating of the item.
    commentCountintThe number of comments for the item.
    commentsEnabledboolWhether comments are allowed on the item.
    culturestringThe item locale information (language and country).
    folderIdstringThe ID of the folder containing the item.
    namestringThe name of this item.
    ownerstringThe username of the user who owns the item.
    ratingCountintThe number of ratings received by the item.
    serviceUrlurlThe service URL for the item.
    sizeqint64The size of the item in bytes.
    typeEnums.PortalItemTypeThe type of the item.
    typeKeywordslist<string>A set of keywords that further describes the type of the item.
    typeNamestringThe name of the type of this item.
    viewCountintThe number of times this item has been viewed.
    descriptionstringThe item description.
    extentEnvelopeThe bounding rectangle of the item.
    snippetstringThe short summary description of the item.
    titlestringThe title of the item.
    accessInformationstringThe access information on the source of the item.
    tagslist<string>The user-defined tags that describe the item.
    createddateThe creation date of the item.
    modifieddateThe date the item was last modified.
    spatialReferenceSpatialReferenceThe spatial reference of the item.
    termsOfUsestringThe terms of use of the item.

    Example: Accessing roles from a PortalItemListModel from within a QML delegate:

    Text {
        anchors {
            fill: parent
            margins: 10
        text: title
        color: "white"
        elide: Text.ElideRight
        wrapMode: Text.Wrap
        horizontalAlignment: Text.AlignHCenter

    See also Portal, PortalUser, and PortalItem.

    Property Documentation

    [read-only] count : int

    Returns the number of objects in the model (read-only).

    [read-only] error : Error

    Returns the error (if any) that occurred (read-only).

    Signal Documentation


    Emitted when the count property of the model changes.

    Note: The corresponding handler is onCountChanged.


    Signal emitted when the error property changes, which can indicate that an error occurred.

    Note: The corresponding handler is onErrorChanged.

    [since Esri.ArcGISRuntime 100.15] itemAdded(int index)

    Signal emitted when an item is added to the model. index The index at which the item was added.

    Note: The corresponding handler is onItemAdded.

    This signal was introduced in Esri.ArcGISRuntime 100.15.

    [since Esri.ArcGISRuntime 100.15] itemRemoved(int index)

    Signal emitted when an item is removed from the model. index The index at which the item was removed.

    Note: The corresponding handler is onItemRemoved.

    This signal was introduced in Esri.ArcGISRuntime 100.15.

    Method Documentation

    bool contains(PortalItem portalItem)

    Returns true if the list model contains the specified portalItem.

    error forEach(callback)

    Receives a callback function to execute for each portalItem in the model.

    The callback function can take 0 to 3 optional arguments, in order:

    Returns undefined if no error occurred, and an error message otherwise.

    const error = PortalItemListModel.forEach(function(element, index, array) {
    if (error) {

    PortalItem get(int index)

    Returns the PortalItem at the specified index.

    [since Esri::ArcGISRuntime 100.5.] int indexOf(PortalItem portalItem)

    Returns the index of a specific portal item (portalItem) from the list model.

    This method was introduced in Esri::ArcGISRuntime 100.5..

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.