PortalGroupListModel QML Type
Represents a particular set of groups in a portal. More...
Import Statement: | import Esri.ArcGISRuntime 100.10 |
Since: | Esri.ArcGISRuntime 100.0 |
Properties
Signals
- countChanged()
- errorChanged()
- portalGroupAdded(int index)
- portalGroupRemoved(int index)
Methods
- bool contains(PortalGroup portalGroup)
- void forEach(callback)
- PortalGroup get(int index)
- int indexOf(PortalGroup portalGroup)
Detailed Description
This model type is returned by:
- Querying a Portal using PortalQueryParametersForGroups.
- Accessing the featuredGroups of a Portal.
- Calling fetchGroups with a PortalItem.
The model returns data for the following roles:
Role | Type | Description |
---|---|---|
access | Enums.PortalAccess | The access level for the group. |
admins | list<string> | The admin users of the group. |
created | date | The date the group was created. |
groupDescription | string | The description of the group. |
groupId | string | The group's ID. |
invitationOnly | bool | Whether the group membership is invitation-only. |
modified | date | The date on which the group was last modified. |
owner | string | The username of the owner of the group. |
phone | string | The telephone number of the group. |
snippet | string | The group summary. |
sortField | Enums.PortalGroupSortField | The field that items in the group are sorted by. |
sortOrder | Enums.PortalQuerySortOrder | The sort order for items in this group. |
tags | string | The user-defined tags that describe the group. |
thumbnailUrl | url | The URL of the thumbnail used for the group. |
title | string | The title of the group. |
users | list<string> | The users of the group. |
viewOnly | bool | Whether the group membership is view-only. |
Example:
Access the various groups of a portalItem:
Connections {
target: portalItem
onFetchGroupsStatusChanged: {
if (portalItem.fetchGroupsStatus !== Enums.TaskStatusCompleted)
return;
console.log("admin groups:");
portalItem.adminGroups.forEach(function(group){
console.log(group.title)
});
console.log("member groups:");
portalItem.memberGroups.forEach(function(group){
console.log(group.title)
});
console.log("other groups:");
portalItem.otherGroups.forEach(function(group){
console.log(group.title)
});
}
}
portalItem.fetchGroups();
Example:
Accessing various roles of the model from within a QML delegate:
Image {
source: thumbnailUrl // use the thumbnailUrl role of the model
fillMode: Image.PreserveAspectCrop
height: parent.height
width: height
}
Text {
text: title // access the title role of the group
font.bold: true
}
See also Portal, PortalGroup, PortalItem, PortalQueryParametersForGroups, and PortalQueryResultSetForGroups.
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 a PortalGroup is added to the list model.
index is the index of the added PortalGroup.
Note: The corresponding handler is onPortalGroupAdded
.
Signal emitted when a PortalGroup is removed from the list model.
index is the index of the removed PortalGroup.
Note: The corresponding handler is onPortalGroupRemoved
.
Method Documentation
bool contains(PortalGroup portalGroup) |
Returns true
if the list model contains the specified PortalGroup portalGroup.
Receives a callback function to execute for each portalGroup in the model.
The callback function can take 0 to 3 optional arguments, in order:
- element Current PortalGroup.
- index Current index in array.
- array Reference to PortalGroupListModel.
Returns undefined if no error occurred, and an error message otherwise.
var error = PortalGroupListModel.forEach(function(element, index, array) {
...
});
if (error) {
console.error(error.message);
}
PortalGroup get(int index) |
Returns the PortalGroup at the specified index.
int indexOf(PortalGroup portalGroup) |
Returns the index of a specific portal group (portalGroup) from the list model.
This method was introduced in Esri::ArcGISRuntime 100.5..