CometChatGroups
functions as a standalone Component, showcasing an accessible list of all available groups. It provides an integral search functionality, allowing you to locate any specific groups swiftly and easily. For each group listed, the group name is displayed by default, in conjunction with the group icon when available. Additionally, it provides a useful feature by displaying the number of members in each group as a subtitle, offering valuable context about group size and activity level.
CometChatGroups
.
onBack
is triggered when you press the back button in the app bar. It has a predefined behavior; when clicked, it navigates to the previous activity. However, you can override this action using the following code snippet.
Methods | Type | Description |
---|---|---|
setLimit | number | sets the number groups that can be fetched in a single request, suitable for pagination |
setSearchKeyword | string | used for fetching groups matching the passed string |
joinedOnly | boolean | to fetch only joined groups |
friendsOnly | boolean | used for fetching only those users in which logged in user is a member |
setTags | Array<string> | used for fetching groups containing the passed tags |
withTags | boolean | used to fetch tags data along with the list of groups |
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
The list of events emitted by the Groups component is as follows.
Events | Description |
---|---|
ccGroupCreated | This will get triggered when the logged in user creates a group |
ccGroupDeleted | This will get triggered when the logged in user deletes a group |
ccGroupLeft | This will get triggered when the logged in user leaves a group |
ccGroupMemberScopeChanged | This will get triggered when the logged in user changes the scope of another group member |
ccGroupMemberBanned | This will get triggered when the logged in user bans a group member from the group |
ccGroupMemberKicked | This will get triggered when the logged in user kicks another group member from the group |
ccGroupMemberUnbanned | This will get triggered when the logged in user unbans a user banned from the group |
ccGroupMemberJoined | This will get triggered when the logged in user joins a group |
ccGroupMemberAdded | This will get triggered when the logged in user add new members to the group |
ccOwnershipChanged | This will get triggered when the logged in user transfer the ownership of their group to some other member |
CometChatGroupEvents
Listener’sCometChatGroupEvents
Listener’sProperty | Description | Code |
---|---|---|
hideHeader | Used to toggle visibility for the toolbar/header | hideHeader?: boolean |
showBackButton | Used to toggle visibility for back button | showBackButton?: boolean |
hideSearch | Used to toggle visibility for search box | hideSearch?: boolean |
hideError | Used to hide error on fetching users | hideError?: boolean |
selectionMode | This method determines the selection mode for groups, enabling users to select either a single user or multiple groups at once. | selectionMode='multiple' |
hideSubmitButton | Used to toggle the visibility of the submit button when selectionMode is enabled. | hideSubmitButton={true} |
searchPlaceholderText | Used to set search placeholder text | searchPlaceholderText='' |