PortalFolderListModel QML Type

  • Esri.ArcGISRuntime
  • PortalFolderListModel
  • Represents the folders in the root folder of a user. More...

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

    Properties

    Signals

    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:

    RoleTypeDescription
    createdQDateTimeThe date the folder was created.
    folderIdQStringThe id of the folder.
    titleQStringThe 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

    [read-only] count : int

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


    [read-only] error : Error

    Returns the Error object (read-only).


    Signal Documentation

    countChanged()

    Emitted when the count property of the model changes.

    Note: The corresponding handler is onCountChanged.


    errorChanged()

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


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

    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.


    error forEach(callback)

    Receives a callback function to execute for each portalFolder 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 = PortalFolderListModel.forEach(function(element, index, array) {
        ...
    });
    if (error) {
        console.error(error.message);
    }

    PortalFolder get(int index)

    Returns the PortalFolder at the specified index.


    [since Esri::ArcGISRuntime 100.5.] 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..


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