Skip To Content ArcGIS for Developers Sign In Dashboard

PortalItemListModel QML Type

Represents a list of portal items. More...

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

Properties

Signals

Methods

  • bool contains(PortalItem portalItem)
  • void forEach(callback )
  • PortalItem get(int index)
  • int indexOf(PortalItem portalItem)
  • void setProperty(int index, string property, variant value)

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:

RoleTypeDescription
urlurlThe URL for the resource represented by the item.
itemIdstringThe ID of the item.
accessEnums.PortalAccessThe level of access to the item.
accessAndUseConstraintsHtmlstringThe access and use constraints HTML.
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.

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

count : int

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


error : Error

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


Signal Documentation

countChanged()

Emitted when the count property of the model changes.


errorChanged()

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


portalItemAdded(int index)

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


portalItemRemoved(int index)

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


Method Documentation

bool contains(PortalItem portalItem)

Whether the list model contains the specified portalItem.


void 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.

var error = PortalItemListModel.forEach(function(element, index, array) {
    ...
});
if (error) {
    console.error(error.message);
}

PortalItem get(int index)

Returns the PortalItem at the specified index.


int indexOf(PortalItem portalItem)

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

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


void setProperty(int index, string property, variant value)

Changes the property of the PortalItem at index in the list model to value.



Feedback on this topic?