Represents the folders in the root folder of a user. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.0 |
Properties
Signals
- countChanged()
- errorChanged()
- itemAdded(int index)
- itemRemoved(int index)
Methods
- bool contains(PortalFolder portalFolder)
- error forEach(callback)
- PortalFolder get(int index)
- int indexOf(PortalFolder portalFolder)
Detailed Description
Folders are used to organize content in a portal. The list of PortalFolder objects is retrieved by calling fetchContent and if the operation is succesful, this model is returned by the portalUser's folders method.
The model returns data for the following roles:
Role | Type | Description |
---|---|---|
created | QDateTime | The date the folder was created. |
folderId | QString | The id of the folder. |
title | QString | The title of the folder. |
Example:
Retrieve the model representing a user's folders:
Connections { target: portalUser function onFetchContentStatusChanged() { if (portalUser.fetchContentStatus !== Enums.TaskStatusCompleted) return; console.log("folders count = ", portalUser.folders.count); } } portalUser.fetchContent();
See also PortalUser and PortalFolder.
Property Documentation
error : Error |
Returns the Error object (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
.
Signal emitted when an item is added to the list model.
index is the index of the added Item.
Note: The corresponding handler is onItemAdded
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Signal emitted when an item is removed from the list model.
index is the index of the removed item.
Note: The corresponding handler is onItemRemoved
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Method Documentation
bool contains(PortalFolder portalFolder) |
Returns true
if the list model contains the specified PortalFolder portalFolder.
Receives a callback function to execute for each portalFolder in the model.
The callback function can take 0 to 3 optional arguments, in order:
- element Current portalFolder.
- index Current index in array.
- array Reference to PortalFolderListModel.
Returns undefined if no error occurred, and an error message otherwise.
const error = PortalFolderListModel.forEach(function(element, index, array) { ... }); if (error) { console.error(error.message); }
PortalFolder get(int index) |
Returns the PortalFolder
at the specified index.
int indexOf(PortalFolder portalFolder) |
Returns the index of a specific portal folder (portalFolder) from the list model.
This method was introduced in Esri::ArcGISRuntime 100.5..